Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Sep 2019 15:18:42 +0000
From:      Brooks Davis <brooks@freebsd.org>
To:        Sid <sid@bsdmail.com>
Cc:        freebsd-toolchain@freebsd.org
Subject:   Re: linker not using make.conf
Message-ID:  <20190904151842.GA71523@spindle.one-eyed-alien.net>
In-Reply-To: <trinity-008aa4cb-9c85-4504-9364-cd7875281113-1567544648345@3c-app-mailcom-lxa02>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Tue, Sep 03, 2019 at 11:04:08PM +0200, Sid wrote:
> In /etc/make.conf, I have
>  LD= /usr/local/bin/ld.lld80
> 
> This is not used for ports. It may be used for building the kernel and world.
> 
>  clang-8: error: unable to execute command: Executable "ld" doesn't exist!
>  clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
>  *** Error code 1
> 
>  XLD= /usr/local/bin/ld.lld80 being set as well also provides the same error. XD sets it for all, but XLD is only applicable if a different compiler is used for ports than kernel and the base. When LD is set, XLD only applies when it is set as well, but this suggests that XLD is not working correctly either.
> 
> I have to manually link /usr/bin/ld to /usr/local/bin/ld.lld80 for ports to build correctly. This is with both make, and with portmaster.
> 
> I built my computer without ld in the base system, and this has worked well. make.conf should reference the chosen linker without having to manually link it. Otherwise, LD in make.conf is not working correctly, and gives the impression that one linker is used, when it's not. This can cause faulty conclusions and confusion for developers as well, who think one linker is set, when it's not.
> 

The LD variable only effects the very few cases where the linker is called
directly.  The linker is almost always run via clang.  If you install the
xtoolchain-llvm80 port it will install a link from
/usr/local/llvm80/bin/ld.lld to /usr/local/llvm80/bin/ld which I think will
be sufficient for your use case.

-- Brooks

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----

iQEcBAEBAgAGBQJdb9XRAAoJEKzQXbSebgfA2W8H/2nRJsxmTUKyNMlnELNQKmpd
3Gv2PbcT1250V2xB5PLb1+amgOagEzJbHnHYkmknHEg+bfJyMnN3/xoKv8DyEphw
SWe3GcdlJnYByMF6HArVqMx4WpkgZx3UrhzYc173wd0DC51ffgHrRzOTbIPZ1qy3
7+PbRcVCKuPIkSa1r/Od6Rt0ePkLwIQ8UC8MH0ncF617Ew0V5vQ1X8dUmqwVTjY2
l7f98iWw9nnnRNyFJSBrlAbCKQV7OqRu9xje2P+vnBVY1ObxBr7B2iGnFdJGWuoo
eQCAyrNI4KQBWFgwdrtAMxpoxEdWF/At3c4GiUlS5I9+diNlagb0LAEgs5wMir4=
=Xkbf
-----END PGP SIGNATURE-----
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190904151842.GA71523>