aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2023-07-12 11:01:54 +0100
committerfanquake <fanquake@gmail.com>2023-07-12 11:22:02 +0100
commit8f6f0d81ee3a9ea582e9c9cf986613da86760098 (patch)
tree012dbaebd1697f811d7a67d5e59a0f390f58ce66 /contrib
parente14473299cd3e55ca177876df957927937648cd6 (diff)
downloadbitcoin-8f6f0d81ee3a9ea582e9c9cf986613da86760098.tar.xz
guix: backport glibc patch to prevent redundant librt link
Diffstat (limited to 'contrib')
-rw-r--r--contrib/guix/manifest.scm3
-rw-r--r--contrib/guix/patches/glibc-2.27-no-librt.patch53
2 files changed, 55 insertions, 1 deletions
diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm
index a9654dec5b..31ac44f8e2 100644
--- a/contrib/guix/manifest.scm
+++ b/contrib/guix/manifest.scm
@@ -558,7 +558,8 @@ inspecting signatures in Mach-O binaries.")
"0azpb9cvnbv25zg8019rqz48h8i2257ngyjg566dlnp74ivrs9vq"))
(patches (search-our-patches "glibc-2.27-riscv64-Use-__has_include-to-include-asm-syscalls.h.patch"
"glibc-2.27-fcommon.patch"
- "glibc-2.27-guix-prefix.patch"))))))
+ "glibc-2.27-guix-prefix.patch"
+ "glibc-2.27-no-librt.patch"))))))
(packages->manifest
(append
diff --git a/contrib/guix/patches/glibc-2.27-no-librt.patch b/contrib/guix/patches/glibc-2.27-no-librt.patch
new file mode 100644
index 0000000000..4f2092ba7e
--- /dev/null
+++ b/contrib/guix/patches/glibc-2.27-no-librt.patch
@@ -0,0 +1,53 @@
+This patch can be dropped when we are building with glibc 2.30+.
+
+commit 6e41ef56c9baab719a02f1377b1e7ce7bff61e73
+Author: Florian Weimer <fweimer@redhat.com>
+Date: Fri Feb 8 10:21:56 2019 +0100
+
+ rt: Turn forwards from librt to libc into compat symbols [BZ #24194]
+
+ As the result of commit 6e6249d0b461b952d0f544792372663feb6d792a
+ ("BZ#14743: Move clock_* symbols from librt to libc."), in glibc 2.17,
+ clock_gettime, clock_getres, clock_settime, clock_getcpuclockid,
+ clock_nanosleep were added to libc, and the file rt/clock-compat.c
+ was added with forwarders to the actual implementations in libc.
+ These forwarders were wrapped in
+
+ #if SHLIB_COMPAT (librt, GLIBC_2_2, GLIBC_2_17)
+
+ so that they are not present for newer architectures (such as
+ powerpc64le) with a 2.17 or later ABI baseline. But the forwarders
+ were not marked as compatibility symbols. As a result, on older
+ architectures, historic configure checks such as
+
+ AC_CHECK_LIB(rt, clock_gettime)
+
+ still cause linking against librt, even though this is completely
+ unnecessary. It also creates a needless porting hazard because
+ architectures behave differently when it comes to symbol availability.
+
+ Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+
+diff --git a/rt/clock-compat.c b/rt/clock-compat.c
+index f816973c05..11e71aa890 100644
+--- a/rt/clock-compat.c
++++ b/rt/clock-compat.c
+@@ -30,14 +30,16 @@
+ #if HAVE_IFUNC
+ # undef INIT_ARCH
+ # define INIT_ARCH()
+-# define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name)
++# define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name) \
++ compat_symbol (librt, name, name, GLIBC_2_2);
+ #else
+ # define COMPAT_REDIRECT(name, proto, arglist) \
+ int \
+ name proto \
+ { \
+ return __##name arglist; \
+- }
++ } \
++ compat_symbol (librt, name, name, GLIBC_2_2);
+ #endif
+
+ COMPAT_REDIRECT (clock_getres,