all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pjotr Prins <pjotr.public12@thebird.nl>
To: guix-devel@gnu.org
Subject: gold linker and collect2: fatal error: cannot find 'ld'
Date: Sun, 17 Mar 2019 17:06:16 +0100	[thread overview]
Message-ID: <20190317160616.cyv5z7lbsrvbajur@thebird.nl> (raw)

Hi all,

I am facing some issues with the gold linker. Dlang's ldc compiler
recently defaulted to gold as a linker. Ironically if I build ldc
itself with binutils-gold it does not find the ld binary. If I don't add
binutils-gold ldc builds fine but the tests fail to find the gold
linker. 

Nice one.

When I build ldc without tests (successfully) the created compiler
environment requires gold. At this point ldc won't honour the --linker
switch where you can provide an alternative (i think this is an ldc
bug - no matter because I think using gold is a great idea). Anyway,
pulling in binutils-gold compiles my software fine if you set
LD_LIBRARY_PATH to LIBRARY_PATH.  This is because the latter is not
honoured by gold.

Note that gold has a compatibility layer for ld, but it does not pick
up environment variables (on purpose).

Unfortunately the runtime of compiled software fails because the rpath is
not updated either. So that requires adding in the RPATH explicitly on
the ldc command line. When I set the RPATH the runtime is fine. 

I am posting this here so others can benefit when they run into
similar issues later. Maybe the solution is to create an ld-wrapper
style gold-wrapper for gold.

Wdyt?

Also I need to somehow resolve the ldc tests running on gold. Can we
pull in standard ld and gold at the same time? binutils-gold suggests
not.

Pj.

             reply	other threads:[~2019-03-17 16:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-17 16:06 Pjotr Prins [this message]
2019-03-18 15:28 ` gold linker and collect2: fatal error: cannot find 'ld' Pjotr Prins
2019-03-19 15:24   ` Pjotr Prins
2019-03-27 17:15   ` Ludovic Courtès
2019-05-01  7:56     ` Pierre Neidhardt
2019-05-16  5:18       ` Pierre Neidhardt
2019-05-17 13:44         ` Pierre Neidhardt
2019-05-17 18:13           ` Pierre Neidhardt
2019-05-20 15:35             ` Ludovic Courtès
2019-05-20 16:06               ` Pierre Neidhardt
2019-05-25 16:35                 ` Pierre Neidhardt
2019-05-25 21:21                   ` Pjotr Prins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190317160616.cyv5z7lbsrvbajur@thebird.nl \
    --to=pjotr.public12@thebird.nl \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.