Enable power10 multilib

* Mon Dec 12 2022 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 2.34-56
- Enable power10 multilib (#1870019)

Resolves: #1870019
This commit is contained in:
Tulio Magno Quites Machado Filho 2022-12-07 17:43:04 -03:00
parent e8ace71c20
commit 78832d4e7a
2 changed files with 85 additions and 41 deletions

View File

@ -69,6 +69,13 @@
%undefine with_valgrind
%endif
# Build the POWER10 runtime on POWER, but only for downstream.
%ifarch ppc64le
%define buildpower10 0%{?rhel} > 0
%else
%define buildpower10 0
%endif
# The annobin annotations cause binutils to produce broken ARM EABI
# unwinding information. Symptom is a hang/test failure for
# malloc/tst-malloc-stats-cancellation. See
@ -148,7 +155,7 @@ end \
Summary: The GNU libc libraries
Name: glibc
Version: %{glibcversion}
Release: 55%{?dist}
Release: 56%{?dist}
# In general, GPLv2+ is used by programs, LGPLv2+ is used for
# libraries.
@ -1688,6 +1695,15 @@ build()
# Default set of compiler options.
build
%if %{buildpower10}
(
GCC="$GCC -mcpu=power10 -mtune=power10"
GXX="$GXX -mcpu=power10 -mtune=power10"
core_with_options="--with-cpu=power10"
build power10
)
%endif
##############################################################################
# Install glibc...
##############################################################################
@ -1755,23 +1771,27 @@ 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
##############################################################################
@ -2466,6 +2486,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================
@ -2712,6 +2742,9 @@ fi
%files -f glibc.filelist
%dir %{_prefix}/%{_lib}/audit
%if %{buildpower10}
%dir /%{_libdir}/glibc-hwcaps/power10
%endif
%verify(not md5 size mtime) %config(noreplace) /etc/nsswitch.conf
%verify(not md5 size mtime) %config(noreplace) /etc/ld.so.conf
%verify(not md5 size mtime) %config(noreplace) /etc/rpc
@ -2803,6 +2836,9 @@ fi
%endif
%changelog
* Mon Dec 12 2022 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 2.34-56
- Earlier removal of alternative multilibs (#2149994)
* Mon Dec 12 2022 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 2.34-55
- Earlier removal of alternative multilibs (#2149994)

View File

@ -18,7 +18,13 @@ set -ex
workdir="$(mktemp -d -t find_debuginfo.XXXXXX)"
ldso_tmp="$workdir/ld.so"
libc_tmp="$workdir/libc.so"
libc_tmp_dir="$workdir/"
# Return the path where a libc should be saved temporarily. This path is
# based on its original path received in $1.
libc_tmp_path() {
echo "$libc_tmp_dir"`dirname "$1"`"/libc.so"
}
# Prefer a separately installed debugedit over the RPM-integrated one.
if command -v debugedit >/dev/null ; then
@ -50,38 +56,56 @@ for ldso_candidate in `find "$sysroot_path" -maxdepth 2 \
done
# libc.so.6 always uses this name, so it is simpler to locate.
libc_path=
for libc_candidate in `find "$sysroot_path" -maxdepth 2 -name libc.so.6`; do
if test -z "$libc_path" ; then
libc_path="$libc_candidate"
else
echo "error: multiple libc.so.6 candidates: $libc_path, $libc_candidate"
exit 1
fi
done
libc_path=`find "$sysroot_path" -name libc.so.6`
# Preserve the original files.
cp "$ldso_path" "$ldso_tmp"
cp "$libc_path" "$libc_tmp"
for lib in $libc_path ; do
libtmp=`libc_tmp_path $lib`
mkdir -p `dirname "$libtmp"`
cp "$lib" "$libtmp"
done
# Run the debuginfo extraction.
"$script_path" "$@"
# libc.so.6: Extract the .gnu_debuglink section
objcopy -j.gnu_debuglink --set-section-flags .gnu_debuglink=alloc \
-O binary "$libc_path" "$libc_tmp.debuglink"
for lib in $libc_path ; do
libtmp=`libc_tmp_path "$lib"`
# libc.so.6: Extract the .gnu_debuglink section
objcopy -j.gnu_debuglink --set-section-flags .gnu_debuglink=alloc \
-O binary "$lib" "$libtmp.debuglink"
# Restore the original files.
cp "$libtmp" "$lib"
# Restore the original files.
# Reduce the size of libc notes. Primarily for annobin.
objcopy --merge-notes "$lib"
# libc.so.6: Restore the .gnu_debuglink section
objcopy --add-section .gnu_debuglink="$libtmp.debuglink" "$lib"
# libc.so.6: Reduce to valuable symbols. Eliminate file symbols,
# annobin symbols, and symbols used by the glibc build to implement
# hidden aliases (__EI_*). We would also like to remove __GI_*
# symbols, but even listing them explicitly (as in -K __GI_strlen)
# still causes strip to remove them, so there is no filtering of
# __GI_* here. (Debuginfo is gone after this, so no need to optimize
# it.)
strip -w \
-K '*' \
-K '!*.c' \
-K '!*.os' \
-K '!.annobin_*' \
-K '!__EI_*' \
-K '!__PRETTY_FUNCTION__*' \
"$lib"
done
# Restore the original ld.so.
cp "$ldso_tmp" "$ldso_path"
cp "$libc_tmp" "$libc_path"
# Reduce the size of notes. Primarily for annobin.
objcopy --merge-notes "$ldso_path"
objcopy --merge-notes "$libc_path"
# libc.so.6: Restore the .gnu_debuglink section
objcopy --add-section .gnu_debuglink="$libc_tmp.debuglink" "$libc_path"
# ld.so does not have separated debuginfo and so the debuginfo file
# generated by find-debuginfo is redundant. Therefore, remove it.
@ -98,22 +122,6 @@ for ldso_debug_candidate in `find "$sysroot_path" -maxdepth 2 \
done
rm -f "$ldso_debug"
# libc.so.6: Reduce to valuable symbols. Eliminate file symbols,
# annobin symbols, and symbols used by the glibc build to implement
# hidden aliases (__EI_*). We would also like to remove __GI_*
# symbols, but even listing them explicitly (as in -K __GI_strlen)
# still causes strip to remove them, so there is no filtering of
# __GI_* here. (Debuginfo is gone after this, so no need to optimize
# it.)
strip -w \
-K '*' \
-K '!*.c' \
-K '!*.os' \
-K '!.annobin_*' \
-K '!__EI_*' \
-K '!__PRETTY_FUNCTION__*' \
"$libc_path"
# ld.so: Rewrite the source file paths to match the extracted
# locations. First compute the arguments for invoking debugedit.
# See find-debuginfo.sh.