From a93939c34320e2b7bd18ad03f66f8eb34a7b2f56 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 25 Jun 2025 10:21:33 +0100 Subject: [PATCH] Add ppc64 workaround patch in order to create a working linker. Relates: RHEL-94763 --- bin.ppc64.gcc.patch | 24 ++++++++++++++++++++++++ binutils.spec | 9 +++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 bin.ppc64.gcc.patch diff --git a/bin.ppc64.gcc.patch b/bin.ppc64.gcc.patch new file mode 100644 index 0000000..77ffd61 --- /dev/null +++ b/bin.ppc64.gcc.patch @@ -0,0 +1,24 @@ +diff -rup binutils.orig/ld/ldlang.c binutils-with-gold-2.44/ld/ldlang.c +--- binutils.orig/ld/ldlang.c 2025-06-25 09:37:36.524268728 +0100 ++++ binutils-with-gold-2.44/ld/ldlang.c 2025-06-25 09:37:54.787387725 +0100 +@@ -8042,6 +8042,19 @@ lang_list_remove_tail (lang_statement_li + { + union lang_statement_union **savetail; + /* Check that ORIGLIST really is an earlier state of DESTLIST. */ ++ ++ if (getenv ("LD_DEBUG_NEVER") != NULL) ++ { ++ /* FIXME: RHEL-49348: For some reason building this function for the ++ PowerPC architecture on RHEL-10 is resulting in a linker that ++ triggers the ASSERT below - because the origlist pointer is ++ corrupt. These fprintf statements, even if they will never be ++ used, are enough to cause the compiler to build the function ++ correctly, thus avoiding the problem. */ ++ fprintf (stderr, "origlist %p destlist %p\n", origlist, destlist); ++ fprintf (stderr, "heads: %p %p\n", origlist->head, destlist->head); ++ } ++ + ASSERT (origlist->head == destlist->head); + savetail = origlist->tail; + origlist->head = *(savetail); +Only in binutils-with-gold-2.44/ld: ldlang.c.orig diff --git a/binutils.spec b/binutils.spec index 93b5494..30928e9 100644 --- a/binutils.spec +++ b/binutils.spec @@ -151,7 +151,7 @@ URL: https://sourceware.org/binutils # Bootstrapping: Set this to 1 to build the binutils with the system gcc. # Then once GTS-gcc is built and in the buildroot, reset this variable # to 0, bump the NVR and rebuild GTS-binutils. -%define bootstrapping 0 +%define bootstrapping 1 #----End of Configure Options------------------------------------------------ @@ -336,6 +336,11 @@ Patch19: binutils-aarch64-small-plt0.patch #---------------------------------------------------------------------------- +# Purpose: Workaround for an unresolved bug in ppc gcc/glibc +# which generates bad code in the linker. cf RHEL-49348 +# Lifetime: TEMPORARY +Patch98: bin.ppc64.gcc.patch + # Purpose: Suppress the x86 linker's p_align-1 tests due to kernel bug on CentOS-10 # Lifetime: TEMPORARY Patch99: binutils-suppress-ld-align-tests.patch @@ -1578,7 +1583,7 @@ exit 0 %changelog * Tue Jun 24 2025 Nick Clifton - 2.44-4 - Use the new gcc-toolset-15-runtime package. (RHEL-94763) -- Disable bootstrapping but also disable annobin. +- Add in the temporary fix for ppc64 gcc/glibc generating bad code. (RHEL-49348) * Mon May 12 2025 Siddhesh Poyarekar - 2.44-3 - Avoid using SCL for c10s.