summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko van der Vossen2021-02-26 18:24:49 +0100
committerRemko van der Vossen2021-02-26 18:24:49 +0100
commit7a6cba2c401ea37814741133536b9e12b47aaf95 (patch)
treecabbfa3fc8ae9f12f91ee5141ab2e8fbf7e5d69b
parent388a3228ed89ee7d343c31076dae2cf966bdace6 (diff)
rsync: rewrite -s option to -Wl,--strip-debug in LDFLAGS
LDFLAGS containing "-s" calls gcc and/or ld with "-s" which means --strip-all with current (2.36) binutils and perhaps earlier versions this causes relocation entries in the .rela.plt section of type R_X86_64_IRELATIV to be replaced with 0-entries having type R_X86_64_NONE (value 0). This breaks the STT_GNU_IFUNC mechanism used by certain shared libraries breaking the rsync binary. Interestingly "strip -s" on the same binary which also is supposed to "strip all" does not show this behavior so it is somehow different from the behavior of ld. Perhaps it is a bug in binutils, though I was not able to find
-rwxr-xr-xftp/rsync/BUILD15
-rw-r--r--ftp/rsync/HISTORY3
2 files changed, 18 insertions, 0 deletions
diff --git a/ftp/rsync/BUILD b/ftp/rsync/BUILD
index d22e99fd61..1dce478cc1 100755
--- a/ftp/rsync/BUILD
+++ b/ftp/rsync/BUILD
@@ -1,3 +1,18 @@
make_single &&
+
+# LDFLAGS containing "-s" calls gcc and/or ld with "-s" which means --strip-all
+# with current (2.36) binutils and perhaps earlier versions this causes
+# relocation entries in the .rela.plt section of type R_X86_64_IRELATIV to be
+# replaced with 0-entries having type R_X86_64_NONE (value 0). This breaks the
+# STT_GNU_IFUNC mechanism used by certain shared libraries breaking the rsync
+# binary.
+#
+# Interestingly "strip -s" on the same binary which also is supposed to "strip
+# all" does not show this behavior so it is somehow different from the behavior
+# of ld. Perhaps it is a bug in binutils, though I was not able to find
+# anything relevant.
+
+LDFLAGS=${LDFLAGS//-s /-Wl,--strip-debug } &&
+LDFLAGS=${LDFLAGS/%-s/-Wl,--strip-debug} &&
default_build &&
make_normal
diff --git a/ftp/rsync/HISTORY b/ftp/rsync/HISTORY
index 03e6b65af1..5603d4e8ea 100644
--- a/ftp/rsync/HISTORY
+++ b/ftp/rsync/HISTORY
@@ -1,3 +1,6 @@
+2021-02-26 Remko van der Vossen <wich@sourcemage.org>
+ * BUILD: rewrite -s option to -Wl,--strip-debug in LDFLAGS
+
2020-08-07 Florian Franzmann <siflfran@hawo.stw.uni-erlangen.de>
* DETAILS: version 3.2.3