Add ppc64 workaround patch in order to create a working linker.

Relates: RHEL-94763
This commit is contained in:
Nick Clifton 2025-06-25 10:21:33 +01:00
parent 8efe2c0ca6
commit a93939c343
2 changed files with 31 additions and 2 deletions

24
bin.ppc64.gcc.patch Normal file
View File

@ -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

View File

@ -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 <nickc@redhat.com> - 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 <siddhesh@redhat.com> - 2.44-3
- Avoid using SCL for c10s.