sys-libs/glibc: avoid GPREL overflow on ia64, bug #723268
authorSergei Trofimovich <slyfox@gentoo.org>
Fri, 15 May 2020 23:11:54 +0000 (00:11 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Fri, 15 May 2020 23:12:14 +0000 (00:12 +0100)
-fno-common had unintended side-effect to optimise more
accesses to global variables as module-local via GPREL22
relocations. Unfortunately glibc is large enough to overflow
GPREL22 offset.

Let's add a -fcommon workaround back to pessimize code slightly
that refers module-local globals. We'll need an equivalen of
-fPIC to do it consistently.

Bug: https://bugs.gentoo.org/723268
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
sys-libs/glibc/glibc-2.30-r8.ebuild
sys-libs/glibc/glibc-2.31-r3.ebuild
sys-libs/glibc/glibc-9999.ebuild

index aea0098e69f742197657e57abcf7486b45375a95..0421d5e61db16df66776565ae2ad147d379f5ab0 100644 (file)
@@ -305,6 +305,12 @@ setup_target_flags() {
                                einfo "Auto adding -march=${t} to CFLAGS_x86 #185404 (ABI=${ABI})"
                        fi
                ;;
+               ia64)
+                       # Workaround GPREL22 overflow by slightly pessimizing global
+                       # references to go via 64-bit relocations instead of 22-bit ones.
+                       # This allows building glibc on ia64 without an overflow: #723268
+                       append-flags -fcommon
+               ;;
                mips)
                        # The mips abi cannot support the GNU style hashes. #233233
                        filter-ldflags -Wl,--hash-style=gnu -Wl,--hash-style=both
index c05055b8811ec0798d6d4de2ef1d62ded1dbef01..5580625ba6d0736528222ec5ebc1300c3349465b 100644 (file)
@@ -299,6 +299,12 @@ setup_target_flags() {
                                einfo "Auto adding -march=${t} to CFLAGS_x86 #185404 (ABI=${ABI})"
                        fi
                ;;
+               ia64)
+                       # Workaround GPREL22 overflow by slightly pessimizing global
+                       # references to go via 64-bit relocations instead of 22-bit ones.
+                       # This allows building glibc on ia64 without an overflow: #723268
+                       append-flags -fcommon
+               ;;
                mips)
                        # The mips abi cannot support the GNU style hashes. #233233
                        filter-ldflags -Wl,--hash-style=gnu -Wl,--hash-style=both
index bba57f5d60756a48327c084acdae8c24a3b37359..2355e5bce34e017582dc21d38a8cf359b5e2cf60 100644 (file)
@@ -298,6 +298,12 @@ setup_target_flags() {
                                einfo "Auto adding -march=${t} to CFLAGS_x86 #185404 (ABI=${ABI})"
                        fi
                ;;
+               ia64)
+                       # Workaround GPREL22 overflow by slightly pessimizing global
+                       # references to go via 64-bit relocations instead of 22-bit ones.
+                       # This allows building glibc on ia64 without an overflow: #723268
+                       append-flags -fcommon
+               ;;
                mips)
                        # The mips abi cannot support the GNU style hashes. #233233
                        filter-ldflags -Wl,--hash-style=gnu -Wl,--hash-style=both