From 7a6cba2c401ea37814741133536b9e12b47aaf95 Mon Sep 17 00:00:00 2001 From: Remko van der Vossen Date: Fri, 26 Feb 2021 18:24:49 +0100 Subject: 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 --- ftp/rsync/BUILD | 15 +++++++++++++++ ftp/rsync/HISTORY | 3 +++ 2 files changed, 18 insertions(+) (limited to 'ftp') 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 + * BUILD: rewrite -s option to -Wl,--strip-debug in LDFLAGS + 2020-08-07 Florian Franzmann * DETAILS: version 3.2.3 -- cgit v1.2.3