mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] Systemd linker errors with ld.gold
@ 2016-07-21  9:54 Riese, Marc AVL DiTEST
  0 siblings, 0 replies; 2+ messages in thread
From: Riese, Marc AVL DiTEST @ 2016-07-21  9:54 UTC (permalink / raw)
  To: ptxdist

Hi,

When using the latest toolchain OSELAS.Toolchain-2016.06.0 together with ptxdist-2016.07.0, I get a few of the following linker errors when building systemd-230, for example:

  CCLD     udevadm
/opt/OSELAS.Toolchain-2016.06.0/arm-cortexa8-linux-gnueabi/gcc-5.4.0-glibc-2.23-binutils-2.26-kernel-4.6-sanitized/lib/gcc/arm-cortexa8-linux-gnueabi/5.4.0/../../../../arm-cortexa8-linux-gnueabi/bin/ld.gold: error: --copy-dt-needed-entries is not supported but is required for libuuid.so.1 in /home/developer/ptxdist/ptxdist-beaglebone/platform-pengutronix-beagleboneti/sysroot-target/usr/lib/libblkid.so
collect2: error: ld returned 1 exit status
Makefile:13013: recipe for target 'udevadm' failed
make[3]: *** [udevadm] Error 1

It seems that some of the libraries in the sysroot-target have been built with ld.bfd instead, which supports the --copy-dt-needed-entries option. The ld.gold manpage says explicitly, that it doesn't support the --copy-dt-needed-entries option.

So, I'm not sure if this is the best solution, but removing systemd's configure.ac LDFLAG for ld.gold fixed this for me, as it defaults back to ld.bfd instead.
Although I'm still wondering, why systemd would use ld.gold at all, when it doesn't support a required option. If someone has an explanation, that would be appreciated.

Best regards,
Marc


--- a/configure.ac	2016-07-21 10:11:53.250039000 +0200
+++ b/configure.ac	2016-07-21 10:12:14.322039000 +0200
@@ -247,8 +247,7 @@
         -Wl,--no-undefined \
         -Wl,-z,relro \
         -Wl,-z,now \
-        -pie \
-        -Wl,-fuse-ld=gold])
+        -pie])
 AC_SUBST([OUR_LDFLAGS], "$with_ldflags $sanitizer_ldflags")
 
 AC_CHECK_SIZEOF(pid_t)

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread
* Re: [ptxdist] Systemd linker errors with ld.gold
@ 2016-07-22 14:43 Riese, Marc AVL DiTEST
  0 siblings, 0 replies; 2+ messages in thread
From: Riese, Marc AVL DiTEST @ 2016-07-22 14:43 UTC (permalink / raw)
  To: ptxdist

Hi,

I've found the explanation...
The linker option "-Wl,--copy-dt-needed-entries" was set in platformconfig's extra LDFLAGS. It was not coming from any systemd dependencies, like util-linux-ng libraries, which I first suspected. So systemd now uses ld.gold and links successfully without any extra patches after a rebuild.

The previous mail and the patch can therefore be disregarded.

Best regards,
Marc


-----Ursprüngliche Nachricht-----
Von: ptxdist [mailto:ptxdist-bounces@pengutronix.de] Im Auftrag von Riese, Marc AVL DiTEST
Gesendet: Donnerstag, 21. Juli 2016 11:54
An: ptxdist@pengutronix.de
Betreff: [ptxdist] Systemd linker errors with ld.gold

Hi,

When using the latest toolchain OSELAS.Toolchain-2016.06.0 together with ptxdist-2016.07.0, I get a few of the following linker errors when building systemd-230, for example:

  CCLD     udevadm
/opt/OSELAS.Toolchain-2016.06.0/arm-cortexa8-linux-gnueabi/gcc-5.4.0-glibc-2.23-binutils-2.26-kernel-4.6-sanitized/lib/gcc/arm-cortexa8-linux-gnueabi/5.4.0/../../../../arm-cortexa8-linux-gnueabi/bin/ld.gold: error: --copy-dt-needed-entries is not supported but is required for libuuid.so.1 in /home/developer/ptxdist/ptxdist-beaglebone/platform-pengutronix-beagleboneti/sysroot-target/usr/lib/libblkid.so
collect2: error: ld returned 1 exit status
Makefile:13013: recipe for target 'udevadm' failed
make[3]: *** [udevadm] Error 1

It seems that some of the libraries in the sysroot-target have been built with ld.bfd instead, which supports the --copy-dt-needed-entries option. The ld.gold manpage says explicitly, that it doesn't support the --copy-dt-needed-entries option.

So, I'm not sure if this is the best solution, but removing systemd's configure.ac LDFLAG for ld.gold fixed this for me, as it defaults back to ld.bfd instead.
Although I'm still wondering, why systemd would use ld.gold at all, when it doesn't support a required option. If someone has an explanation, that would be appreciated.

Best regards,
Marc


--- a/configure.ac	2016-07-21 10:11:53.250039000 +0200
+++ b/configure.ac	2016-07-21 10:12:14.322039000 +0200
@@ -247,8 +247,7 @@
         -Wl,--no-undefined \
         -Wl,-z,relro \
         -Wl,-z,now \
-        -pie \
-        -Wl,-fuse-ld=gold])
+        -pie])
 AC_SUBST([OUR_LDFLAGS], "$with_ldflags $sanitizer_ldflags")
 
 AC_CHECK_SIZEOF(pid_t)

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-22 14:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-21  9:54 [ptxdist] Systemd linker errors with ld.gold Riese, Marc AVL DiTEST
2016-07-22 14:43 Riese, Marc AVL DiTEST

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox