Bug#803474: src:systemd: Please use the default linker instead of gold on sparc64

John Paul Adrian Glaubitz glaubitz at physik.fu-berlin.de
Fri Oct 30 15:26:29 GMT 2015


On 10/30/2015 01:59 PM, John Paul Adrian Glaubitz wrote:
> Could you please change the build system (e.g. rules file) such that it uses
> ld/bfd on *both* sparc *and* sparc64 (we are planning to ressurrect sparc
> in the future)?

More specific, please re-apply this patch [1] and extend it for sparc64
as well:

diff --git a/debian/rules b/debian/rules
index f7effa5..78074ff 100755
--- a/debian/rules
+++ b/debian/rules
@@ -10,6 +10,13 @@ ifneq (,$(findstring stage1,$(DEB_BUILD_PROFILES)))
 BOOTSTRAP_DH_FLAGS := -Ngir1.2-gudev-1.0 -Nlibgudev-1.0-0
-Nlibgudev-1.0-dev
 endif

+# sparc/sparc64 must use the bfd linker since gold will
+# will result in broken shared libraries
+ifneq ($(findstring $(DEB_BUILD_ARCH), sparc sparc64),)
+    LD=ld
+endif
+
+
 CONFFLAGS = \
 	--with-rootprefix= \
 	--with-rootlibdir=/lib/$(DEB_HOST_MULTIARCH) \

This patch was dropped when gudev was removed from systemd upstream
assuming that linking with gold would affect gudev only. However,
it affects linking against libsystemd and libudev in general,
for example usbutils [2]:

/bin/bash ../libtool  --tag=CC   --mode=link gcc  -Os -Wall -g -O2
-fstack-protector-strong -Wformat -Werror=format-security
-I/usr/include/libusb-1.0   -Wl,-z,relro -o usbhid-dump usbhid-dump.o
../lib/libuhd.la -lusb-1.0
libtool: link: gcc -Os -Wall -g -O2 -fstack-protector-strong -Wformat
-Werror=format-security -I/usr/include/libusb-1.0 -Wl,-z -Wl,relro -o
usbhid-dump usbhid-dump.o  ../lib/.libs/libuhd.a -lusb-1.0
/usr/bin/ld: //lib/sparc64-linux-gnu/libudev.so.1: Only registers
%g[2367] can be declared using STT_REGISTER
//lib/sparc64-linux-gnu/libudev.so.1: error adding symbols: No such file
or directory
collect2: error: ld returned 1 exit status

Thanks,

Adrian

> [1]
https://anonscm.debian.org/cgit/pkg-systemd/systemd.git/commit/debian/rules?id=8e9833a6f297a0c69180ba4a4801fd1d396b17a9
> [2]
https://buildd.debian.org/status/fetch.php?pkg=usbutils&arch=sparc64&ver=1%3A007-4&stamp=1444471387
-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz at debian.org
`. `'   Freie Universitaet Berlin - glaubitz at physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913




More information about the Pkg-systemd-maintainers mailing list