Enable power10 multilib

Co-authored-by: Florian Weimer <fweimer@redhat.com>
This commit is contained in:
Tulio Magno Quites Machado Filho 2024-04-12 19:19:34 +02:00 committed by Florian Weimer
parent 34d1409178
commit 09d1856f52

View File

@ -61,6 +61,13 @@
%endif %endif
%endif %endif
# Build the POWER10 multilib.
%ifarch ppc64le
%define buildpower10 1
%else
%define buildpower10 0
%endif
%if %{with bootstrap} %if %{with bootstrap}
# Disable benchtests, -Werror, docs, and valgrind if we're bootstrapping # Disable benchtests, -Werror, docs, and valgrind if we're bootstrapping
%undefine with_benchtests %undefine with_benchtests
@ -1359,6 +1366,17 @@ build build-%{target} \
%endif %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... # Install glibc...
############################################################################## ##############################################################################
@ -1437,23 +1455,28 @@ install_different()
mkdir -p "$destdir" mkdir -p "$destdir"
mkdir -p "$libdestdir" mkdir -p "$libdestdir"
# Walk all of the libraries we installed... # 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 do
libbase=${lib#*/} libbase=${lib#*/}
# Take care that `libbaseso' has a * that needs expanding so # Take care that `libbaseso' has a * that needs expanding so
# take care with quoting. # 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. # Only install if different from default build library.
if cmp -s ${lib}.so ../build-%{target}/${lib}.so; then if cmp -s ${lib}.so ../build-%{target}/${lib}.so; then
ln -sf "$subdir_up"/$libbaseso $libdestdir/$libbaseso ln -sf "$subdir_up"/$libbaseso $libdestdir/$libbaseso
else else
cp -a ${lib}.so $libdestdir/$libbaseso cp -a ${lib}.so $libdestdir/$libbaseso
fi fi
dlib=$libdestdir/$(basename %{glibc_sysroot}/%{_lib}/${libbase}.so.*)
ln -sf $libbaseso $dlib
done 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 # Remove the files we don't want to distribute
############################################################################## ##############################################################################
@ -2185,6 +2208,16 @@ pushd build-%{target}
run_tests run_tests
popd 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===================== echo ====================TESTING END=====================
PLTCMD='/^Relocation section .*\(\.rela\?\.plt\|\.rela\.IA_64\.pltoff\)/,/^$/p' PLTCMD='/^Relocation section .*\(\.rela\?\.plt\|\.rela\.IA_64\.pltoff\)/,/^$/p'
echo ====================PLT RELOCS LD.SO================ echo ====================PLT RELOCS LD.SO================
@ -2406,6 +2439,9 @@ update_gconv_modules_cache ()
%files -f glibc.filelist %files -f glibc.filelist
%dir %{_prefix}/%{_lib}/audit %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/ld.so.conf
%verify(not md5 size mtime) %config(noreplace) /etc/rpc %verify(not md5 size mtime) %config(noreplace) /etc/rpc
%dir /etc/ld.so.conf.d %dir /etc/ld.so.conf.d