diff --git a/glibc.spec b/glibc.spec index d7d47dc..f078653 100644 --- a/glibc.spec +++ b/glibc.spec @@ -61,6 +61,13 @@ %endif %endif +# Build the POWER10 multilib. +%ifarch ppc64le +%define buildpower10 1 +%else +%define buildpower10 0 +%endif + %if %{with bootstrap} # Disable benchtests, -Werror, docs, and valgrind if we're bootstrapping %undefine with_benchtests @@ -1359,6 +1366,17 @@ build build-%{target} \ %endif # +# POWER10 build variant. +%if %{buildpower10} +build build-%{target}-power10 \ + CC="gcc $glibc_flags_cc" \ + CXX="g++ $glibc_flags_cc" \ + CFLAGS="$glibc_flags_cflags" \ + --with-cpu=power10 \ +# +%endif + + ############################################################################## # Install glibc... ############################################################################## @@ -1437,23 +1455,28 @@ install_different() mkdir -p "$destdir" mkdir -p "$libdestdir" # Walk all of the libraries we installed... - for lib in libc math/libm nptl/libpthread rt/librt nptl_db/libthread_db + for lib in libc math/libm do libbase=${lib#*/} # Take care that `libbaseso' has a * that needs expanding so # take care with quoting. - libbaseso=$(basename %{glibc_sysroot}/%{_lib}/${libbase}-*.so) + libbaseso=$(basename %{glibc_sysroot}/%{_lib}/${libbase}.so.*) # Only install if different from default build library. if cmp -s ${lib}.so ../build-%{target}/${lib}.so; then ln -sf "$subdir_up"/$libbaseso $libdestdir/$libbaseso else cp -a ${lib}.so $libdestdir/$libbaseso fi - dlib=$libdestdir/$(basename %{glibc_sysroot}/%{_lib}/${libbase}.so.*) - ln -sf $libbaseso $dlib done } +%if %{buildpower10} +pushd build-%{target}-power10 +install_different "$RPM_BUILD_ROOT/%{_libdir}/glibc-hwcaps" power10 .. +popd +%endif + + ############################################################################## # Remove the files we don't want to distribute ############################################################################## @@ -2185,6 +2208,16 @@ pushd build-%{target} run_tests popd +%if %{buildpower10} +# Run this test only if the server supports Power10 instructions. +if LD_SHOW_AUXV=1 /bin/true | grep -E "AT_HWCAP2:[^$]*arch_3_1" > /dev/null; then + echo ====================TESTING -mcpu=power10============= + pushd build-%{target}-power10 + run_tests + popd +fi +%endif + echo ====================TESTING END===================== PLTCMD='/^Relocation section .*\(\.rela\?\.plt\|\.rela\.IA_64\.pltoff\)/,/^$/p' echo ====================PLT RELOCS LD.SO================ @@ -2406,6 +2439,9 @@ update_gconv_modules_cache () %files -f glibc.filelist %dir %{_prefix}/%{_lib}/audit +%if %{buildpower10} +%dir /%{_libdir}/glibc-hwcaps/power10 +%endif %verify(not md5 size mtime) %config(noreplace) /etc/ld.so.conf %verify(not md5 size mtime) %config(noreplace) /etc/rpc %dir /etc/ld.so.conf.d