void-packages/srcpkgs/glibc/patches/0001-Revert-Do-not-use-hash...

52 lines
1.6 KiB
Diff

Temporary workaround for EAC bug.
See: https://sourceware.org/bugzilla/show_bug.cgi?id=29456
From 8e90e2cc5e57d7ca3a40602d278e9642a8b66716 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 13 Sep 2022 14:30:35 -0700
Subject: [PATCH] Revert "Do not use --hash-style=both for building glibc
shared objects"
This reverts commit e47de5cb2d4dbecb58f569ed241e8e95c568f03c.
---
Makeconfig | 9 +++++++++
Makerules | 7 +++++++
5 files changed, 61 insertions(+)
diff --git a/Makeconfig b/Makeconfig
index ba70321af1..e2131d4389 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -371,6 +371,13 @@ dt-relr-ldflag =
no-dt-relr-ldflag =
endif
+# For the time being we unconditionally use 'both'. At some time we
+# should declare statically linked code as 'out of luck' and compile
+# with --hash-style=gnu only.
+hashstyle-LDFLAGS = -Wl,--hash-style=both
+LDFLAGS.so += $(hashstyle-LDFLAGS)
+LDFLAGS-rtld += $(hashstyle-LDFLAGS)
+
ifeq (no,$(build-pie-default))
pie-default = $(no-pie-ccflag)
else # build-pie-default
diff --git a/Makerules b/Makerules
index d1e139d03c..44134e37ce 100644
--- a/Makerules
+++ b/Makerules
@@ -558,6 +558,9 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
-Wl,--verbose 2>/dev/null | \
sed > $@T \
-e '/^=========/,/^=========/!d;/^=========/d' \
+ -e 's/^.*\.gnu\.hash[ ]*:.*$$/ .note.ABI-tag : { *(.note.ABI-tag) } &/' \
+ -e '/^[ ]*\.hash[ ]*:.*$$/{h;d;}' \
+ -e '/DATA_SEGMENT_ALIGN/{H;g}' \
-e 's/^.*\*(\.dynbss).*$$/& \
PROVIDE(__start___libc_freeres_ptrs = .); \
*(__libc_freeres_ptrs) \
--
2.37.3