Siddhesh,
I've lightly tested this and it seems to be working as expected.
What do you think?
(a) Add conditional compile targets.
In general it creates conditional compilation targets for:
* testsuite - Enabled by default, allows you to turn off testsuite
* benchtests - Enabled by default.
* werror - Enabled by default. Disabled always for certain targets.
* docs - Enabled by default. Disabling it removes texinfo requirement.
- Bug in check-safety.sh IMO requires makeinfo (texinfo), but
I'll fix this.
* valgrind - Enabled by default. Used to disable valgrind tests.
* bootstrap - Disabled by default. Enabling it automatically turns off
werror, docs, and valgrind.
While %bcond_* simplifies some of the weird logic via the %if %{with foo}
construct, it also leads to more knobs. I don't see any more knobs required
other than those above, so we can always try hard not to slide into lots
of knobs scenario.
(b) Remove c_stubs add-on.
We want full static compilation support and making static binaries smaller
by stubbing stuff out is just going to come back and bite us.
(c) Remove librtkaio support.
Already discussed on fedora devel and in bug 1227855.
diff --git a/glibc.spec b/glibc.spec
index bf8f2e2..b465c12 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -1,6 +1,6 @@
%define glibcsrcdir glibc-2.22-70-gd5dff79
%define glibcversion 2.22.90
-%define glibcrelease 3%{?dist}
+%define glibcrelease 4%{?dist}
# Pre-release tarballs are pulled in from git using a command that is
# effectively:
#
@@ -11,21 +11,45 @@
# glibc_release_url is only defined when we have a release tarball.
# % define glibc_release_url http://ftp.gnu.org/gnu/glibc/
##############################################################################
-# If run_glibc_tests is zero then tests are not run for the build.
-# You must always set run_glibc_tests to one for production builds.
-%define run_glibc_tests 1
-%define build_benchtests 1
-# Run valgrind test to ensure compatibility.
+# If testsuite is zero (implied by passing the '--without' 'testsuite'
+# option to rpmbuild) then tests are not run for the build. You must always
+# run the testsuite for production builds.
+# Default: Always run the testsuite.
+%bcond_without testsuite
+# Default: Always build the benchtests.
+%bcond_without benchtests
+# Default: Not bootstrapping.
+%bcond_with bootstrap
+# Default: Enable using -Werror
+%bcond_without werror
+# Default: Always build documentation.
+%bcond_without docs
+# Default: Always run valgrind tests
+%bcond_without valgrind
+
+# Run a valgrind smoke test to ensure that the release is compatible and
+# doesn't any new feature that might cause valgrind to abort.
+%if %{with valgrind}
%ifarch %{ix86} x86_64 ppc ppc64le s390x armv7hl aarch64
-%define run_valgrind_tests 1
+%global _with_valgrind 1
+%endif
+%ifarch s390 ppc64
+# Notes: Skipping 32-bit s390? Skipping 64-bit BE ppc64?
+%global _with_valgrind 0
+%endif
%endif
# Disable -Werror in builds for these architectures
+%if %{with werror}
%ifarch s390x
-%define disable_werror 1
+%global _with_werror 0
+%endif
+%endif
+# Disable -Werror, docs, and valgrind if we're bootstrapping
+%if %{with bootstrap}
+%global _with_werror 0
+%global _with_docs 0
+%global _with_valgrind 0
%endif
-# Disable -Werror if we're bootstrapping
-%{!?_with_bootstrap: %global disable_werror 1}
-
##############################################################################
# Auxiliary arches are those arches that can be built in addition
# to the core supported arches. You either install an auxarch or
@@ -63,12 +87,6 @@
%define buildpower6 0
%endif
##############################################################################
-# We build librtkaio for all rtkaioarches. The library is installed into
-# a distinct subdirectory in the lib dir. This define enables the rtkaio
-# add-on during the build. Upstream does not have rtkaio and it is provided
-# strictly as part of our builds.
-%define rtkaioarches %{ix86} x86_64 ppc %{power64} s390 s390x
-##############################################################################
# Any architecture/kernel combination that supports running 32-bit and 64-bit
# code in userspace is considered a biarch arch.
%define biarcharches %{ix86} x86_64 ppc %{power64} s390 s390x
@@ -179,16 +197,6 @@ Patch0034: glibc-fedora-elf-init-hidden_undef.patch
# Support mangling and demangling null pointers.
Patch0037: glibc-rh952799.patch
-# rtkaio and c_stubs. Note that despite the numbering, these are always
-# applied first.
-Patch0038: glibc-rtkaio.patch
-Patch0039: glibc-c_stubs.patch
-
-# Remove non-ELF support in rtkaio
-Patch0040: glibc-rh731833-rtkaio.patch
-Patch0041: glibc-rh731833-rtkaio-2.patch
-Patch0042: glibc-rh970865.patch
-
# ARM: Accept that some objects marked hard ABI are now not because of a
# binutils bug.
Patch0044: glibc-rh1009145.patch
@@ -205,11 +213,6 @@ Patch0052: glibc-disable-rwlock-elision.patch
# symlink to it.
Patch0053: glibc-cs-path.patch
-# Remove the clock_* functions and use the ones in libc like librt does.
-Patch0054: glibc-rtkaio-clock.patch
-
-Patch0055: glibc-rtkaio-libof.patch
-
##############################################################################
#
# Patches from upstream
@@ -286,12 +289,16 @@ Requires(pre): basesystem, libgcc
# This is for building auxiliary programs like memusage, nscd
# For initial glibc bootstraps it can be commented out
-BuildRequires: gd-devel libpng-devel zlib-devel texinfo, libselinux-devel >= 1.33.4-3
+BuildRequires: gd-devel libpng-devel zlib-devel
+%if %{with docs}
+BuildRequires: texinfo
+%endif
+BuildRequires: libselinux-devel >= 1.33.4-3
BuildRequires: audit-libs-devel >= 1.1.3, sed >= 3.95, libcap-devel, gettext, nss-devel
BuildRequires: /bin/ps, /bin/kill, /bin/awk
BuildRequires: systemtap-sdt-devel
-%if 0%{?run_valgrind_tests}
+%if %{with valgrind}
BuildRequires: /usr/bin/valgrind
%endif
@@ -550,7 +557,7 @@ package or when debugging this package.
%endif # %{debuginfocommonarches}
%endif # 0%{?_enable_debug_packages}
-%if %{build_benchtests}
+%if %{with benchtests}
%package benchtests
Summary: Benchmarking binaries and scripts for %{name}
Group: Development/Debug
@@ -565,11 +572,7 @@ microbenchmark tests on the system.
%prep
%setup -q -n %{glibcsrcdir}
-# Patch order is important as some patches depend on other patches and
-# therefore the order must not be changed. First two are rtkaio and c_stubs;
-# we maintain this only in Fedora.
-%patch0038 -p1
-%patch0039 -p1
+# Patch order matters.
%patch0001 -p1
%patch0003 -p1
%patch0004 -p1
@@ -594,9 +597,6 @@ microbenchmark tests on the system.
%patch0033 -p1
%patch0034 -p1
%patch0037 -p1
-%patch0040 -p1
-%patch0041 -p1
-%patch0042 -p1
%patch0044 -p1
%patch0046 -p1
%patch2031 -p1
@@ -605,7 +605,6 @@ microbenchmark tests on the system.
%patch2034 -p1
%patch0052 -p1
%patch0053 -p1
-%patch0054 -p1
%patch3002 -p1
%patch2035 -p1
@@ -614,7 +613,6 @@ microbenchmark tests on the system.
%patch2103 -p1
%patch2104 -p1
%patch2105 -p1
-%patch0055 -p1
##############################################################################
# %%prep - Additional prep required...
@@ -764,7 +762,7 @@ build()
%ifarch %{lock_elision_arches}
--enable-lock-elision \
%endif
-%if 0%{?disable_werror}
+%if %{with werror}
--disable-werror \
%endif
--disable-profile --enable-nss-crypt ||
@@ -1332,7 +1330,7 @@ pushd build-%{target}
make BENCH_DURATION=1 bench-build
popd
-%if %{build_benchtests}
+%if %{with benchtests}
# Copy over benchmark binaries.
mkdir -p $RPM_BUILD_ROOT%{_prefix}/libexec/glibc-benchtests
cp $(find build-%{target}/benchtests -type f -executable) $RPM_BUILD_ROOT%{_prefix}/libexec/glibc-benchtests/
@@ -1532,7 +1530,7 @@ truncate -s 0 $RPM_BUILD_ROOT/var/cache/ldconfig/aux-cache
# Run the glibc testsuite
##############################################################################
%check
-%if %{run_glibc_tests}
+%if %{with testsuite}
# Run the glibc tests. If any tests fail to build we exit %check with an error
# of 1, otherwise we print the test failure list and the failed test output
@@ -1627,7 +1625,7 @@ echo ====================PLT RELOCS LIBC.SO==============
readelf -Wr $RPM_BUILD_ROOT/%{_lib}/libc-*.so | sed -n -e "$PLTCMD"
echo ====================PLT RELOCS END==================
-%if 0%{?run_valgrind_tests}
+%if %{with valgrind}
# Finally, check if valgrind runs with the new glibc.
# We want to fail building if valgrind is not able to run with this glibc so
# that we can then coordinate with valgrind to get it fixed before we update
@@ -1759,6 +1757,7 @@ rm -f *.filelist*
%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/ld.so.cache
%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/gai.conf
%doc README NEWS INSTALL BUGS PROJECTS CONFORMANCE elf/rtld-debugger-interface.txt
+# If rpm doesn't support %license, then use %doc instead.
%{!?_licensedir:%global license %%doc}
%license COPYING COPYING.LIB LICENSES
%doc hesiod/README.hesiod
@@ -1824,12 +1823,23 @@ rm -f *.filelist*
%endif
%endif
-%if %{build_benchtests}
+%if %{with benchtests}
%files benchtests -f benchtests.filelist
%defattr(-,root,root)
%endif
%changelog
+* Mon Aug 24 2015 Carlos O'Donell <carlos(a)redhat.com> - 2.22.90-4
+- Support --without testsuite option to disable testing after build.
+- Support --without benchtests option to disable microbenchmarks.
+- Update --with bootstrap support to disable valgrind, and documentation
+ during bootstrap.
+- Support --without werror to disable building with -Werror.
+- Support --without docs to disable build requirement on texinfo.
+- Support --without valgrind to disable testing with valgrind.
+- Remove c_stubs add-on and enable fuller support for static binaries.
+- Remove librtkaio support (#1227855).
+
* Sun Aug 16 2015 Siddhesh Poyarekar <siddhesh(a)redhat.com> - 2.22.90-3
- Auto-sync with upstream master.
---
Cheers,
Carlos.