Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Dec 2012 13:36:25 +0100
From:      Erik Cederstrand <erik@cederstrand.dk>
To:        "toolchain@freebsd.org" <toolchain@freebsd.org>
Cc:        Pete chou <pete.chou@gmail.com>
Subject:   Using non-standard linker
Message-ID:  <089FCDB5-C0D2-4675-AB71-FD7089BFA031@cederstrand.dk>

next in thread | raw e-mail | index | archive | help
Hi folks,

I'm working with Pete Chou from MCLinker (actually, he's doing almost =
all the work) to get mclinker to survive a buildworld. The goal is to =
allow mclinker to be a drop-in replacement for GNU ld.

My first suggestion was to just add LD=3D/usr/local/bin/mclinker to =
src.conf. But this only works when ld is invoked explicitly (and only =
when 'ld' is not hard-coded, of course).

When ld is invoked internally by the compiler, Pete has tested that =
gcc(collect2) and clang do not respect the LD variable, but search for =
'ld' in COMPILER_PATH and then PATH instead. Since mclinker is not part =
of the build process, it isn't found in COMPILER_PATH, and GNU ld is =
used instead. Instead, he can add an additional compiler search path via =
the "-B" flag, which seems to work.

I'm worried that 'ld' is so hard-wired everywhere that it's impossible =
to specify another name. In that case, my suggestion would be to use =
build knobs, e.g. WITH_GNU_LD and WITH_MCLINKER_LD to install either GNU =
ld or mclinker as 'ld', but that wouldn't work unless mclinker is =
imported into base.

What's the FreeBSD way of doing this? What do other toolchains do if =
they use a non-GNU ld linker?

Thanks,
Erik=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?089FCDB5-C0D2-4675-AB71-FD7089BFA031>