| |
@@ -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
|
| |
@@ -69,16 +76,8 @@
|
| |
%undefine with_valgrind
|
| |
%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
|
| |
- # <https://bugzilla.redhat.com/show_bug.cgi?id=1951492>.
|
| |
- %ifarch armv7hl
|
| |
- %undefine _annotated_build
|
| |
- %endif
|
| |
-
|
| |
# We do our own build flags management. In particular, see
|
| |
- # rpm_inherit_flags below.
|
| |
+ # glibc_shell_* below.
|
| |
%undefine _auto_set_build_flags
|
| |
|
| |
##############################################################################
|
| |
@@ -171,7 +170,7 @@
|
| |
# - 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 9
|
| |
+ %global baserelease 10
|
| |
Release: %{baserelease}%{?dist}
|
| |
|
| |
# Licenses:
|
| |
@@ -238,6 +237,36 @@
|
| |
# Include in the source RPM for reference.
|
| |
Source12: ChangeLog.old
|
| |
|
| |
+ # ABI-specific program interpreter name. Used for debuginfo
|
| |
+ # extraction (wrap-find-debuginfo.sh) and smoke testing ($run_ldso below).
|
| |
+ %ifarch %{ix86}
|
| |
+ %global glibc_ldso /lib/ld-linux.so.2
|
| |
+ %endif
|
| |
+ %ifarch aarch64
|
| |
+ %global glibc_ldso /lib/ld-linux-aarch64.so.1
|
| |
+ %endif
|
| |
+ %ifarch ppc
|
| |
+ %global glibc_ldso /lib/ld.so.1
|
| |
+ %endif
|
| |
+ %ifarch ppc64
|
| |
+ %global glibc_ldso /lib64/ld64.so.1
|
| |
+ %endif
|
| |
+ %ifarch ppc64le
|
| |
+ %global glibc_ldso /lib64/ld64.so.2
|
| |
+ %endif
|
| |
+ %ifarch riscv64
|
| |
+ %global glibc_ldso /lib/ld-linux-riscv64-lp64d.so.1
|
| |
+ %endif
|
| |
+ %ifarch s390
|
| |
+ %global glibc_ldso /lib/ld.so.1
|
| |
+ %endif
|
| |
+ %ifarch s390x
|
| |
+ %global glibc_ldso /lib/ld64.so.1
|
| |
+ %endif
|
| |
+ %ifarch x86_64 x86_64_v2 x86_64_v3 x86_64_v4
|
| |
+ %global glibc_ldso /lib64/ld-linux-x86-64.so.2
|
| |
+ %endif
|
| |
+
|
| |
######################################################################
|
| |
# Activate the wrapper script for debuginfo generation, by rewriting
|
| |
# the definition of __debug_install_post.
|
| |
@@ -249,7 +278,7 @@
|
| |
-- Avoid embedded newlines that confuse the macro definition.
|
| |
original = original:match("^%s*(.-)%s*$"):gsub("\\\n", "")
|
| |
rpm.define("__debug_install_post bash " .. wrapper
|
| |
- .. " " .. sysroot .. " " .. original)
|
| |
+ .. " " .. sysroot .. " %{glibc_ldso} " .. original)
|
| |
}
|
| |
|
| |
# sysroot package support. These contain arch-specific packages, so
|
| |
@@ -389,10 +418,7 @@
|
| |
BuildRequires: gcc >= 7.2.1-6
|
| |
%global enablekernel 3.2
|
| |
Conflicts: kernel < %{enablekernel}
|
| |
- %global target %{_target_cpu}-redhat-linux
|
| |
- %ifarch %{arm}
|
| |
- %global target %{_target_cpu}-redhat-linuxeabi
|
| |
- %endif
|
| |
+ %define target %{_target_cpu}-redhat-linux
|
| |
%ifarch ppc64le
|
| |
%global target ppc64le-redhat-linux
|
| |
%endif
|
| |
@@ -1192,78 +1218,97 @@
|
| |
cat /proc/meminfo
|
| |
df
|
| |
|
| |
- # We build using the native system compilers.
|
| |
- GCC=gcc
|
| |
- GXX=g++
|
| |
-
|
| |
- # Part of rpm_inherit_flags. Is overridden below.
|
| |
- rpm_append_flag ()
|
| |
- {
|
| |
- BuildFlags="$BuildFlags $*"
|
| |
- }
|
| |
-
|
| |
- # Propagates the listed flags to rpm_append_flag if supplied by
|
| |
- # redhat-rpm-config.
|
| |
- BuildFlags="-O2 -g"
|
| |
- rpm_inherit_flags ()
|
| |
- {
|
| |
- local reference=" $* "
|
| |
- local flag
|
| |
- for flag in $RPM_OPT_FLAGS $RPM_LD_FLAGS ; do
|
| |
- if echo "$reference" | grep -q -F " $flag " ; then
|
| |
- rpm_append_flag "$flag"
|
| |
- fi
|
| |
- done
|
| |
- }
|
| |
-
|
| |
# Propgate select compiler flags from redhat-rpm-config. These flags
|
| |
# are target-dependent, so we use only those which are specified in
|
| |
# redhat-rpm-config. We keep the -m32/-m32/-m64 flags to support
|
| |
# multilib builds.
|
| |
- #
|
| |
- # Note: For building alternative run-times, care is required to avoid
|
| |
- # overriding the architecture flags which go into CC/CXX. The flags
|
| |
- # below are passed in CFLAGS.
|
| |
-
|
| |
- rpm_inherit_flags \
|
| |
- "-Wp,-D_GLIBCXX_ASSERTIONS" \
|
| |
- "-fasynchronous-unwind-tables" \
|
| |
- "-fstack-clash-protection" \
|
| |
- "-fno-omit-frame-pointer" \
|
| |
- "-funwind-tables" \
|
| |
- "-m31" \
|
| |
- "-m32" \
|
| |
- "-m64" \
|
| |
- "-march=armv8-a+lse" \
|
| |
- "-march=armv8.1-a" \
|
| |
- "-march=haswell" \
|
| |
- "-march=i686" \
|
| |
- "-march=x86-64" \
|
| |
- "-march=x86-64-v2" \
|
| |
- "-march=x86-64-v3" \
|
| |
- "-march=x86-64-v4" \
|
| |
- "-march=z13" \
|
| |
- "-march=z14" \
|
| |
- "-march=z15" \
|
| |
- "-march=zEC12" \
|
| |
- "-mbackchain" \
|
| |
- "-mbranch-protection=standard" \
|
| |
- "-mcpu=power10" \
|
| |
- "-mcpu=power8" \
|
| |
- "-mcpu=power9" \
|
| |
- "-mfpmath=sse" \
|
| |
- "-mno-omit-leaf-frame-pointer" \
|
| |
- "-msse2" \
|
| |
- "-mstackrealign" \
|
| |
- "-mtune=generic" \
|
| |
- "-mtune=power10" \
|
| |
- "-mtune=power8" \
|
| |
- "-mtune=power9" \
|
| |
- "-mtune=z13" \
|
| |
- "-mtune=z14" \
|
| |
- "-mtune=z15" \
|
| |
- "-mtune=zEC12" \
|
| |
- "-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1" \
|
| |
+
|
| |
+ %{lua:
|
| |
+ -- Split the string argument into keys of an associate array.
|
| |
+ -- The values are set to true.
|
| |
+ local function string_to_array(s)
|
| |
+ local result = {}
|
| |
+ for e in string.gmatch(s, "%S+") do
|
| |
+ result[e] = true
|
| |
+ end
|
| |
+ return result
|
| |
+ end
|
| |
+
|
| |
+ local inherit_flags = {}
|
| |
+
|
| |
+ -- These flags are put into the CC and CXX arguments to configure.
|
| |
+ -- Alternate builds do not use the flags listed here, only the main build does.
|
| |
+ inherit_flags.cc_main = string_to_array [[
|
| |
+ -march=armv8-a+lse
|
| |
+ -march=armv8.1-a
|
| |
+ -march=haswell
|
| |
+ -march=i686
|
| |
+ -march=x86-64
|
| |
+ -march=x86-64-v2
|
| |
+ -march=x86-64-v3
|
| |
+ -march=x86-64-v4
|
| |
+ -march=z13
|
| |
+ -march=z14
|
| |
+ -march=z15
|
| |
+ -march=zEC12
|
| |
+ -mcpu=power10
|
| |
+ -mcpu=power8
|
| |
+ -mcpu=power9
|
| |
+ -mtune=generic
|
| |
+ -mtune=power10
|
| |
+ -mtune=power8
|
| |
+ -mtune=power9
|
| |
+ -mtune=z13
|
| |
+ -mtune=z14
|
| |
+ -mtune=z15
|
| |
+ -mtune=zEC12
|
| |
+ ]]
|
| |
+
|
| |
+ -- Like inherit_flags_cc_main, but also used for alternate builds.
|
| |
+ inherit_flags.cc = string_to_array [[
|
| |
+ -m31
|
| |
+ -m32
|
| |
+ -m64
|
| |
+ ]]
|
| |
+
|
| |
+ -- These flags are passed through CFLAGS and CXXFLAGS.
|
| |
+ inherit_flags.cflags = string_to_array [[
|
| |
+ -O2
|
| |
+ -O3
|
| |
+ -Wall
|
| |
+ -Wp,-D_GLIBCXX_ASSERTIONS
|
| |
+ -fasynchronous-unwind-tables
|
| |
+ -fno-omit-frame-pointer
|
| |
+ -fstack-clash-protection
|
| |
+ -funwind-tables
|
| |
+ -g
|
| |
+ -mbackchain
|
| |
+ -mbranch-protection=standard
|
| |
+ -mfpmath=sse
|
| |
+ -mno-omit-leaf-frame-pointer
|
| |
+ -msse2
|
| |
+ -mstackrealign
|
| |
+ -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1
|
| |
+ ]]
|
| |
+
|
| |
+ -- Iterate over the build_cflags RPM variable and emit a shell
|
| |
+ -- variable that contains the inherited flags of the indicated variant.
|
| |
+ local function shell_build_flags(variant)
|
| |
+ local result = {}
|
| |
+ local inherit = assert(inherit_flags[variant])
|
| |
+ for f in string.gmatch(rpm.expand("%build_cflags"), "%S+") do
|
| |
+ if inherit[f] then
|
| |
+ result[#result + 1] = f
|
| |
+ end
|
| |
+ end
|
| |
+ print("glibc_flags_" .. variant .. "=\"" .. table.concat(result, " ")
|
| |
+ .. "\"\n")
|
| |
+ end
|
| |
+
|
| |
+ shell_build_flags('cc_main') -- Set $glibc_flags_cc_main.
|
| |
+ shell_build_flags('cc') -- Set $glibc_flags_cc.
|
| |
+ shell_build_flags('cflags') -- Set $glibc_flags_cflags.
|
| |
+ }
|
| |
|
| |
%if 0%{?_annotated_build} > 0
|
| |
# libc_nonshared.a cannot be built with the default hardening flags
|
| |
@@ -1285,34 +1330,29 @@
|
| |
# %%build - Generic options.
|
| |
##############################################################################
|
| |
EnableKernel="--enable-kernel=%{enablekernel}"
|
| |
- # Save the used compiler and options into the file "Gcc" for use later
|
| |
- # by %%install.
|
| |
- echo "$GCC" > Gcc
|
| |
|
| |
##############################################################################
|
| |
# build()
|
| |
- # Build glibc in `build-%{target}$1', passing the rest of the arguments
|
| |
- # as CFLAGS to the build (not the same as configure CFLAGS). Several
|
| |
+ # Build glibc in the directory $1, passing the rest of the arguments
|
| |
+ # as additional configure arguments. Several
|
| |
# global values are used to determine build flags, kernel version,
|
| |
# system tap support, etc.
|
| |
##############################################################################
|
| |
build()
|
| |
{
|
| |
- local builddir=build-%{target}${1:+-$1}
|
| |
- ${1+shift}
|
| |
+ local builddir=$1
|
| |
+ shift
|
| |
rm -rf $builddir
|
| |
mkdir $builddir
|
| |
pushd $builddir
|
| |
- ../configure CC="$GCC" CXX="$GXX" CFLAGS="$BuildFlags $*" \
|
| |
+ ../configure "$@" \
|
| |
--prefix=%{_prefix} \
|
| |
--with-headers=%{_prefix}/include $EnableKernel \
|
| |
--with-nonshared-cflags="$BuildFlagsNonshared" \
|
| |
--enable-bind-now \
|
| |
--build=%{target} \
|
| |
- ${configure_host} \
|
| |
--enable-stack-protector=strong \
|
| |
--enable-systemtap \
|
| |
- ${core_with_options} \
|
| |
%ifarch %{ix86}
|
| |
--disable-multi-arch \
|
| |
%endif
|
| |
@@ -1347,17 +1387,34 @@
|
| |
|
| |
%ifarch x86_64
|
| |
# Build for the glibc32 package.
|
| |
- GCC="$GCC -m32" GXX="$GXX -m32" BuildFlags="${BuildFlags/-m64/-m32}" configure_host="--host=i686-linux-gnu" build 32
|
| |
+ build build-%{target}-32 \
|
| |
+ CC="gcc -m32" \
|
| |
+ CXX="g++ -m32" \
|
| |
+ CFLAGS="${glibc_flags_cflags/-m64/-m32}" \
|
| |
+ --host=i686-linux-gnu \
|
| |
+ #
|
| |
%endif
|
| |
|
| |
- configure_host=""
|
| |
-
|
| |
+ # Default set of compiler options.
|
| |
+ build build-%{target} \
|
| |
+ CC="gcc $glibc_flags_cc $glibc_flags_cc_main" \
|
| |
+ CXX="g++ $glibc_flags_cc $glibc_flags_cc_main" \
|
| |
+ CFLAGS="$glibc_flags_cflags" \
|
| |
%ifarch x86_64
|
| |
- configure_host="--enable-cet"
|
| |
+ --enable-cet \
|
| |
+ %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
|
| |
|
| |
- # Default set of compiler options.
|
| |
- build
|
| |
|
| |
##############################################################################
|
| |
# Install glibc...
|
| |
@@ -1373,9 +1430,6 @@
|
| |
# Remove existing file lists.
|
| |
find . -type f -name '*.filelist' -exec rm -rf {} \;
|
| |
|
| |
- # Reload compiler and build options that were used during %%build.
|
| |
- GCC=`cat Gcc`
|
| |
-
|
| |
%ifarch riscv64
|
| |
# RISC-V ABI wants to install everything in /lib64/lp64d or /usr/lib64/lp64d.
|
| |
# Make these be symlinks to /lib64 or /usr/lib64 respectively. See:
|
| |
@@ -1440,23 +1494,28 @@
|
| |
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
|
| |
##############################################################################
|
| |
@@ -2188,6 +2247,16 @@
|
| |
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================
|
| |
@@ -2196,19 +2265,7 @@
|
| |
readelf -Wr %{glibc_sysroot}/%{_lib}/libc-*.so | sed -n -e "$PLTCMD"
|
| |
echo ====================PLT RELOCS END==================
|
| |
|
| |
- # Obtain a way to run the dynamic loader. Avoid matching the symbolic
|
| |
- # link and then pick the first loader (although there should be only
|
| |
- # one). Use -maxdepth 2 to avoid descending into the /sys-root/
|
| |
- # sub-tree. See wrap-find-debuginfo.sh.
|
| |
- %ifarch x86_64
|
| |
- # Hardcode the patch to avoid picking up the 32-bit dynamic linker from
|
| |
- # glibc32; both 32-bit and 64-bit dynamic linkers will be present.
|
| |
- ldso_path="%{glibc_sysroot}/lib64/ld-linux-x86-64.so.2"
|
| |
- %else
|
| |
- ldso_path="$(find %{glibc_sysroot}/ -maxdepth 2 -regextype posix-extended \
|
| |
- -regex '.*/ld(-.*|64|)\.so\.[0-9]+$' -type f | LC_ALL=C sort | head -n1)"
|
| |
- %endif
|
| |
- run_ldso="$ldso_path --library-path %{glibc_sysroot}/%{_lib}"
|
| |
+ run_ldso="%{glibc_sysroot}/%{glibc_ldso} --library-path %{glibc_sysroot}/%{_lib}"
|
| |
|
| |
# Show the auxiliary vector as seen by the new library
|
| |
# (even if we do not perform the valgrind test).
|
| |
@@ -2239,13 +2296,11 @@
|
| |
error("FATAL: kernel too old", 0)
|
| |
end
|
| |
|
| |
- %post -p <lua>
|
| |
- %glibc_post_funcs
|
| |
-- (1) Remove multilib libraries from previous installs.
|
| |
-- In order to support in-place upgrades, we must immediately remove
|
| |
- -- obsolete platform directories after installing a new glibc
|
| |
+ -- all platform directories before installing a new glibc
|
| |
-- version. RPM only deletes files removed by updates near the end
|
| |
- -- of the transaction. If we did not remove the obsolete platform
|
| |
+ -- of the transaction. If we did not remove all platform
|
| |
-- directories here, they may be preferred by the dynamic linker
|
| |
-- during the execution of subsequent RPM scriptlets, likely
|
| |
-- resulting in process startup failures.
|
| |
@@ -2318,7 +2373,9 @@
|
| |
end
|
| |
end
|
| |
|
| |
- -- (2) Update /etc/ld.so.conf
|
| |
+ %post -p <lua>
|
| |
+ %glibc_post_funcs
|
| |
+ -- (1) Update /etc/ld.so.conf
|
| |
-- Next we update /etc/ld.so.conf to ensure that it starts with
|
| |
-- a literal "include ld.so.conf.d/*.conf".
|
| |
|
| |
@@ -2357,14 +2414,14 @@
|
| |
end
|
| |
end
|
| |
|
| |
- -- (3) Rebuild ld.so.cache early.
|
| |
+ -- (2) Rebuild ld.so.cache early.
|
| |
-- If the format of the cache changes then we need to rebuild
|
| |
-- the cache early to avoid any problems running binaries with
|
| |
-- the new glibc.
|
| |
|
| |
call_ldconfig()
|
| |
|
| |
- -- (4) Update gconv modules cache.
|
| |
+ -- (3) Update gconv modules cache.
|
| |
-- If the /usr/lib/gconv/gconv-modules.cache exists, then update it
|
| |
-- with the latest set of modules that were just installed.
|
| |
-- We assume that the cache is in _libdir/gconv and called
|
| |
@@ -2372,7 +2429,7 @@
|
| |
|
| |
update_gconv_modules_cache()
|
| |
|
| |
- -- (5) On upgrades, restart systemd if installed. "systemctl -q" does
|
| |
+ -- (4) On upgrades, restart systemd if installed. "systemctl -q" does
|
| |
-- not suppress the error message (which is common in chroots), so
|
| |
-- open-code rpm.execute with standard error suppressed.
|
| |
if tonumber(arg[2]) >= 2
|
| |
@@ -2421,6 +2478,9 @@
|
| |
|
| |
%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
|
| |
@@ -2496,6 +2556,9 @@
|
| |
%endif
|
| |
|
| |
%changelog
|
| |
+ * Fri May 03 2024 Florian Weimer <fweimer@redhat.com> - 2.39-10
|
| |
+ - Build POWER10 multilib
|
| |
+
|
| |
* Fri Apr 26 2024 Florian Weimer <fweimer@redhat.com> - 2.39-9
|
| |
- nscd is currently not build, so the security fixes below are not relevant.
|
| |
- Sync with upstream branch release/2.39/master,
|
| |
This is a conflict-free cherry-pick of the POWER10 changes in #92, except for the last commit, which is new: it is a temporary kludge to keep valgrind working. It effectively reverts the CC/CFLAGS injection fixes we need for POWER10 building on x86-64.
I see an i686 test failure on the c10s builder:
It's likely that this is because
sysdeps/pthread/tst-cancel30.c
usesSYS_ppoll_time64
without fallback toSYS_ppoll
, so the thread encountersENOSYS
and just exits, usually without being canceled. This doesn't show up on the Fedora Koji builders.