From dcd95b1bb89dbb6b311c19ed4219e61b9e2cdfec Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 6 Nov 2024 14:12:00 +0100 Subject: [PATCH] Eliminate glibc-headers and related packages The headers are identical except for and , which are specific to the arch-full glibc-devel packages. RPM is expected to handle the identical files shared between glibc-devel.x86_64 and glibc-devel.i686 because it's needed for pretty much every other -devel package. (This version of this change preserves the glibc-devel.x86_64 contents.) --- glibc.spec | 120 +++++++++++++++++------------------------------------ 1 file changed, 39 insertions(+), 81 deletions(-) diff --git a/glibc.spec b/glibc.spec index 5cde2bb..1d9e061 100644 --- a/glibc.spec +++ b/glibc.spec @@ -80,31 +80,6 @@ # glibc_shell_* below. %undefine _auto_set_build_flags -############################################################################## -# Any architecture/kernel combination that supports running 32-bit and 64-bit -# code in userspace is considered a biarch arch. -%global biarcharches %{ix86} x86_64 s390 s390x - -# Avoid generating a glibc-headers package on architectures which are -# not biarch. -%ifarch %{biarcharches} -%global need_headers_package 1 -%if 0%{?rhel} > 0 -%global headers_package_name glibc-headers -%else -%ifarch %{ix86} x86_64 -%global headers_package_name glibc-headers-x86 -%endif -%ifarch s390 s390x -%global headers_package_name glibc-headers-s390 -%endif -%dnl !rhel -%endif -%else -%global need_headers_package 0 -%dnl !biarcharches -%endif - ############################################################################## # Utility functions for pre/post scripts. Stick them at the beginning of # any lua %pre, %post, %postun, etc. sections to have them expand into @@ -170,7 +145,7 @@ Version: %{glibcversion} # - It allows using the Release number without the %%dist tag in the dependency # generator to make the generated requires interchangeable between Rawhide # and ELN (.elnYY < .fcXX). -%global baserelease 26 +%global baserelease 27 Release: %{baserelease}%{?dist} # Licenses: @@ -632,14 +607,21 @@ Requires: %{name} = %{version}-%{release} Requires: libxcrypt-devel%{_isa} >= 4.0.0 Requires: kernel-headers >= 3.2 BuildRequires: kernel-headers >= 3.2 -%if %{need_headers_package} -Requires: %{headers_package_name} = %{version}-%{release} -%endif -%if !(0%{?rhel} > 0 && %{need_headers_package}) # For backwards compatibility, when the glibc-headers package existed. Provides: glibc-headers = %{version}-%{release} Provides: glibc-headers(%{_target_cpu}) Obsoletes: glibc-headers < %{version}-%{release} +# For backwards compatibility with alternative Fedora approach to +# work around multilib issue in composes. +%if 0%{?fedora} +%ifarch x86_64 +Provides: glibc-headers-x86 = %{version}-%{release} +Obsoletes: glibc-headers-x86 < %{version}-%{release} +%endif +%ifarch s390x +Provides: glibc-headers-s390 = %{version}-%{release} +Obsoletes: glibc-headers-s390 < %{version}-%{release} +%endif %endif %description devel @@ -686,32 +668,6 @@ The glibc-static package contains the C library static libraries for -static linking. You don't need these, unless you link statically, which is highly discouraged. -############################################################################## -# glibc "headers" sub-package -# - The headers package includes all common headers that are shared amongst -# the multilib builds. It avoids file conflicts between the architecture- -# specific glibc-devel variants. -# Files like gnu/stubs.h which have gnu/stubs-32.h (i686) and gnu/stubs-64.h -# are included in glibc-headers, but the -32 and -64 files are in their -# respective i686 and x86_64 devel packages. -############################################################################## -%if %{need_headers_package} -%package -n %{headers_package_name} -Summary: Additional internal header files for glibc-devel. -Requires: %{name} = %{version}-%{release} -%if 0%{?rhel} > 0 -Provides: %{name}-headers(%{_target_cpu}) -Obsoletes: glibc-headers-x86 < %{version}-%{release} -Obsoletes: glibc-headers-s390 < %{version}-%{release} -%else -BuildArch: noarch -%endif - -%description -n %{headers_package_name} -The %{headers_package_name} package contains the architecture-specific -header files which cannot be included in glibc-devel package. -%endif - ############################################################################## # glibc "common" sub-package ############################################################################## @@ -1579,6 +1535,8 @@ rm -f lib/libnss_db* lib/libnss_hesiod* lib/libnsl* usr/lib/libnsl* usr/lib/libn rm usr/lib/libc_malloc_debug.so strip -g usr/lib/*.o popd +mkdir glibc32-headers +cp -a %{glibc_sysroot}%{_includedir} glibc32-headers %endif # Build and install: @@ -1591,6 +1549,23 @@ popd # via hardlinks, so we must group them ourselves. hardlink -c %{glibc_sysroot}/usr/lib/locale +%ifarch x86_64 +# Verify that there are no unexpected differences in the header files common +# between i386 and x86_64. +diff -ur %{glibc_sysroot}%{_includedir} glibc32-headers/include \ + > glibc-32-64.diff || true +if test -s glibc-32-64.diff ; then + if test $(grep -v '^Only in ' glibc-32-64.diff | wc -l) -ne 0; then + : Unexpected header file differences + exit 1 + fi +else + : Missing additional stubs header files. +fi +rm glibc-32-64.diff +rm -rf glibc32-headers +%endif + %if %{glibc_autorequires} mkdir -p %{glibc_sysroot}/%{_rpmconfigdir} %{glibc_sysroot}/%{_fileattrsdir} sed < %{SOURCE3} \ @@ -1975,23 +1950,6 @@ split_sysroot_file_list () { remove_from_filelist "$4" "$5" } -# glibc-devel historically contains a subset of the files in -# /usr/include/gnu. The remaining headers are in glibc-headers-*. -# The -regex clause skips /usr/include, which is owned by the -# filesystem package. The x86_64 exception is required because there -# are headers that should be part of the glibc32 package only. -%if %{need_headers_package} -split_sysroot_file_list \ - %{_includedir} '( - ! -regex .*%{_includedir}$ -%ifarch x86_64 - ! -regex .*%{_includedir}/gnu/.*-32\.h$ -%endif - )' \ - '%{_includedir}/gnu/(stubs|lib-names)-.*\.h$' \ - headers.filelist devel.filelist -%endif - # The primary gconv converters are in the glibc package, the rest goes # into glibc-gconv-extra. The Z9 and Z900 subpatterns are for # s390x-specific converters. The -name clause skips over files @@ -2372,12 +2330,8 @@ update_gconv_modules_cache () %{_datarootdir}/i18n/locales %{_datarootdir}/i18n/charmaps -%if %{need_headers_package} -%files -f devel.filelist devel -%else %files devel %{_includedir}/* -%endif %if %{glibc_autorequires} %attr(0755,root,root) %{_rpmconfigdir}/glibc.req %{_fileattrsdir}/glibc.attr @@ -2403,6 +2357,11 @@ update_gconv_modules_cache () %if %{glibc_has_libmvec} %{_libdir}/libmvec.so %endif +%ifarch x86_64 +# This files are included in the buildroot for glibc32 below. +%exclude %{_includedir}/gnu/lib-names-32.h +%exclude %{_includedir}/gnu/stubs-32.h +%endif %if %{with docs} %files doc @@ -2420,10 +2379,6 @@ update_gconv_modules_cache () %{_libdir}/libmvec.a %endif -%if %{need_headers_package} -%files -f headers.filelist -n %{headers_package_name} -%endif - %files utils %{_bindir}/memusage %{_bindir}/memusagestat @@ -2478,6 +2433,9 @@ update_gconv_modules_cache () %endif %changelog +* Wed Nov 6 2024 Florian Weimer - 2.39-27 +- Eliminate glibc-headers and related packages + * Tue Nov 5 2024 Florian Weimer - 2.39-26 - Complete Features/UsrMove (aka UsrMerge, MoveToUsr) transition (#1063607)