From 5f38c0099e200b7c7618e8a97a6390cef90948a6803d4448b187a4c3c62a8e1a Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 20 Jan 2021 10:10:56 +0000 Subject: [PATCH] Accepting request 864620 from home:Andreas_Schwab:Factory - Remove support for %optimize_power - Move to power4 baseline on ppc OBS-URL: https://build.opensuse.org/request/show/864620 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=576 --- glibc.changes | 6 ++ glibc.spec | 257 ++++++++------------------------------------------ 2 files changed, 47 insertions(+), 216 deletions(-) diff --git a/glibc.changes b/glibc.changes index 942dac3..fdf61c9 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jan 19 13:52:09 UTC 2021 - Andreas Schwab + +- Remove support for %optimize_power +- Move to power4 baseline on ppc + ------------------------------------------------------------------- Tue Dec 15 16:41:29 UTC 2020 - Andreas Schwab diff --git a/glibc.spec b/glibc.spec index d8776ae..3476e9c 100644 --- a/glibc.spec +++ b/glibc.spec @@ -1,7 +1,7 @@ # # spec file for package glibc # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -109,29 +109,6 @@ BuildArch: i686 %define disable_assert 0 %define enable_stackguard_randomization 1 -%ifarch ppc ppc64 - %define optimize_power 1 - %ifarch ppc - %define powerpc_optimize_base %{nil} - %define powerpc_optimize_tune power3 - %define powerpc_optimize_cpu_power4 1 - %else - %define powerpc_optimize_base %{nil} - %define powerpc_optimize_tune power5 - %define powerpc_optimize_cpu_power4 0 - %endif - # We are not building Power CPU specific optimizations for openSUSE. - %define powerpc_optimize_cpu_power6 0 - %define powerpc_optimize_cpu_power7 0 - %define powerpc_optimize_cpu_cell 0 -%else - %define optimize_power 0 - %define powerpc_optimize_base %{nil} - %define powerpc_optimize_cpu_power4 0 - %define powerpc_optimize_cpu_power6 0 - %define powerpc_optimize_cpu_power7 0 - %define powerpc_optimize_cpu_cell 0 -%endif # glibc requires at least kernel 3.2 %define enablekernel 3.2 # some architectures need a newer kernel @@ -509,26 +486,6 @@ makedb: A program to create a database for nss %patch3000 -# -# Inconsistency detected by ld.so: dl-close.c: 719: _dl_close: Assertion `map->l_init_called' failed! -# -# Glibc 2.8 introduced the HP_TIMING element to the rtld_global_ro struct # definition. -# If the base is built without power4 the loader won't have this element in -# the struct whereas the power4/5/6/... libc will, so there will be a disconnect -# between the size of the rtld_global_ro struct between the two and dl_close -# ends up getting called incorrectly when it's actually attempting to call a -# resolver function. This is because the GLRO() macro simply attempts to -# compute an offset and gets the wrong one. -# Building the base glibc with --with-cpu=power4 solves this problem. -# But: ppc32 can not default to -mcpu=power4 because it would emit instructions -# which are not available on G3, G4 etc. -# -# We simply remove the power4 files, and build the base glibc for a generic powerpc cpu -# Additional cputuned libs can now be used on powerpc32 -# -rm -fv sysdeps/powerpc/powerpc32/power4/hp-timing.c sysdeps/powerpc/powerpc32/power4/hp-timing.h -find . -name configure | xargs touch - %build # Disable LTO due to a usage of top-level assembler that # causes LTO issues (boo#1138807). @@ -597,6 +554,7 @@ BuildCCplus="%__cxx" %endif %ifarch ppc ppc64 BuildFlags="$(echo $BuildFlags | sed 's#-mminimal-toc##')" + BuildFlags+=" -mtune=power5" %endif %ifarch ppc64 BuildCC="$BuildCC -m64" @@ -617,106 +575,63 @@ BuildCCplus="%__cxx" %define enable_stackguard_randomization 0 %endif -configure_and_build_glibc() { - local dirname="$1"; shift - local cflags="$1"; shift - mkdir "cc-$dirname" - cd "cc-$dirname" +# +# Build base glibc +# +mkdir cc-base +cd cc-base %ifarch %arm aarch64 - # remove asynchronous-unwind-tables during configure as it causes - # some checks to fail spuriously on arm - conf_cflags="${cflags/-fasynchronous-unwind-tables/}" - conf_cflags="${conf_cflags/-funwind-tables/}" +# remove asynchronous-unwind-tables during configure as it causes +# some checks to fail spuriously on arm +conf_cflags="${BuildFlags/-fasynchronous-unwind-tables/}" +conf_cflags="${conf_cflags/-funwind-tables/}" %else - conf_cflags="$cflags" +conf_cflags="$BuildFlags" %endif - profile="--disable-profile" %if %{build_profile} - if [ "$dirname" = "base" ] ; then - profile="--enable-profile" - fi +profile="--enable-profile" +%else +profile="--disable-profile" %endif - ../configure \ - CFLAGS="$conf_cflags" BUILD_CFLAGS="$conf_cflags" \ - CC="$BuildCC" CXX="$BuildCCplus" \ - --prefix=%{_prefix} \ - --libexecdir=%{_libexecdir} --infodir=%{_infodir} \ - $profile \ - "$@" \ - --build=%{target} --host=%{target} \ +../configure \ + CFLAGS="$conf_cflags" BUILD_CFLAGS="$conf_cflags" \ + CC="$BuildCC" CXX="$BuildCCplus" \ + --prefix=%{_prefix} \ + --libexecdir=%{_libexecdir} --infodir=%{_infodir} \ + $profile \ + --build=%{target} --host=%{target} \ %ifarch armv7hl ppc ppc64 ppc64le i686 x86_64 sparc sparc64 s390 s390x - --enable-multi-arch \ + --enable-multi-arch \ %endif %ifarch mipsel - --without-fp \ + --without-fp \ +%endif +%ifarch ppc + --with-cpu=power4 \ %endif %ifarch ppc64p7 - --with-cpu=power7 \ + --with-cpu=power7 \ %endif %ifarch x86_64 %if %suse_version > 1500 - --enable-cet \ + --enable-cet \ %endif %endif %if %{enable_stackguard_randomization} - --enable-stackguard-randomization \ -%endif - ${enable_stack_protector:+--enable-stack-protector=$enable_stack_protector} \ - --enable-tunables \ - --enable-kernel=%{enablekernel} \ - --with-bugurl=http://bugs.opensuse.org \ - --enable-bind-now \ - --enable-systemtap \ - --disable-timezone-tools \ - --disable-crypt - # explicitly set CFLAGS to use the full CFLAGS (not the reduced one for configure) - make %{?_smp_mflags} CFLAGS="$cflags" BUILD_CFLAGS="$cflags" - cd .. -} - -%if !%{optimize_power} - # - # Build base glibc - # - configure_and_build_glibc base "$BuildFlags" -%else - # - # Build POWER-optimized glibc - # - # First, base build: - pBuildFlags="$BuildFlags -mtune=%{powerpc_optimize_tune}" - %if "%{powerpc_optimize_base}" != "" - pBuildFlags+=" -mcpu=%{powerpc_optimize_base}" - %endif - %if "%{powerpc_optimize_base}" != "" - configure_and_build_glibc base "$pBuildFlags" --with-cpu=%{powerpc_optimize_base} - %else - # Use no default CPU - configure_and_build_glibc base "$pBuildFlags" - %endif - %if %{build_variants} - # Then other power variants: - for pcpu in \ - %if %{powerpc_optimize_cpu_power4} - power4 \ - %endif - %if %{powerpc_optimize_cpu_power6} - power6 \ - %endif - %if %{powerpc_optimize_cpu_power7} - power7 \ - %endif - ; do - configure_and_build_glibc $pcpu "$BuildFlags -mcpu=$pcpu" \ - --with-cpu=$pcpu - done - # Eventually, special Cell variant: - %if %{powerpc_optimize_cpu_cell} - configure_and_build_glibc ppc-cell-be "$BuildFlags -mcpu=cell" - %endif - %endif + --enable-stackguard-randomization \ %endif + ${enable_stack_protector:+--enable-stack-protector=$enable_stack_protector} \ + --enable-tunables \ + --enable-kernel=%{enablekernel} \ + --with-bugurl=http://bugs.opensuse.org \ + --enable-bind-now \ + --enable-systemtap \ + --disable-timezone-tools \ + --disable-crypt +# explicitly set CFLAGS to use the full CFLAGS (not the reduced one for configure) +make %{?_smp_mflags} CFLAGS="$BuildFlags" BUILD_CFLAGS="$BuildFlags" +cd .. # # Build html documentation @@ -786,62 +701,8 @@ export STRIP_KEEP_SYMTAB=*.so* # Install base glibc make %{?_smp_mflags} install_root=%{buildroot} install -C cc-base -install_optimized_variant() { - local dirname="$1"; shift - local subdir="$1"; shift - local subdir_up="$1"; shift - -cd "cc-$dirname" -destdir=$RPM_BUILD_ROOT/%{_lib}/$subdir -mkdir -p $destdir -# Don't run a complete make install, we know which libraries -# we want -for lib in libc math/libm nptl/libpthread rt/librt nptl_db/libthread_db -do - libbase=${lib#*/} - libbaseso=$(basename $RPM_BUILD_ROOT/%{_lib}/${libbase}-*.so) - # Only install if different from base lib - if cmp -s ${lib}.so ../cc-base/${lib}.so; then - ln -sf $subdir_up/$libbaseso $destdir/$libbaseso - else - cp -a ${lib}.so $destdir/$libbaseso - fi -done -cd .. -cc-base/elf/ldconfig -vn $destdir -} - -# Install power-optimized glibc -%if %{optimize_power} - %if %{powerpc_optimize_cpu_power4} - install_optimized_variant power4 power4 ".." - %endif - %if %{powerpc_optimize_cpu_power6} - install_optimized_variant power6 power6 ".." - %endif - %if %{powerpc_optimize_cpu_power7} - install_optimized_variant power7 power7 ".." - %endif - %if %{powerpc_optimize_cpu_cell} - install_optimized_variant ppc-cell-be ppc-cell-be ".." - %endif - %if %{powerpc_optimize_cpu_power6} - # power6 is compatible with power6x - # doing a directory symlink doesnt work, ldconfig follows them and accepts only the first real dir - if test -d %{buildroot}/%{_lib}/power6; then - mkdir -p %{buildroot}/%{_lib}/power6x - for i in %{buildroot}/%{_lib}/power6/*.so; do - b=$(basename $i) - ln -vs ../power6/$b %{buildroot}/%{_lib}/power6x/$b - done - cc-base/elf/ldconfig -vn %{buildroot}/%{_lib}/power6x - fi - %endif -%endif - # Install locales %if %{build_locales} - # XXX Do not install locales in parallel! cd cc-base # localedef creates hardlinks to other locales if possible # this will not work if we generate them in parallel. @@ -1042,19 +903,11 @@ remove_dirs = { "/%{_lib}/i686/", %endif %ifarch ppc ppc64 -%if !%{powerpc_optimize_cpu_power4} "/%{_lib}/power4/", "/%{_lib}/ppc970/", -%endif "/%{_lib}/power5/", "/%{_lib}/power5+/", -%if !%{powerpc_optimize_cpu_power6} "/%{_lib}/power6/", "/%{_lib}/power6x/", -%endif -%if !%{powerpc_optimize_cpu_power7} "/%{_lib}/power7/", -%endif -%if !%{powerpc_optimize_cpu_cell} "/%{_lib}/ppc-cell-be/", -%endif %endif "/%{_lib}/tls/" } @@ -1218,34 +1071,6 @@ exit 0 /%{_lib}/libthread_db.so.1 /%{_lib}/libutil-%{libversion}.so /%{_lib}/libutil.so.1 -%define optimized_libs() \ - %dir %attr(0755,root,root) /%{_lib}/%1\ - /%{_lib}/%1/libc-%{libversion}.so\ - /%{_lib}/%1/libc.so.6*\ - /%{_lib}/%1/libm-%{libversion}.so\ - /%{_lib}/%1/libm.so.6*\ - /%{_lib}/%1/libpthread-%{libversion}.so\ - /%{_lib}/%1/libpthread.so.0\ - /%{_lib}/%1/librt-%{libversion}.so\ - /%{_lib}/%1/librt.so.1\ - /%{_lib}/%1/libthread_db-1.0.so\ - /%{_lib}/%1/libthread_db.so.1 - -%if %{optimize_power} - %if %{powerpc_optimize_cpu_power4} - %{optimized_libs power4} - %endif - %if %{powerpc_optimize_cpu_power6} - %{optimized_libs power6} - %{optimized_libs power6x} - %endif - %if %{powerpc_optimize_cpu_power7} - %{optimized_libs power7} - %endif - %if %{powerpc_optimize_cpu_cell} - %{optimized_libs ppc-cell-be} - %endif -%endif %dir %attr(0700,root,root) /var/cache/ldconfig /sbin/ldconfig %{_bindir}/gencat