From owner-freebsd-toolchain@freebsd.org Wed Sep 4 15:18:50 2019 Return-Path: Delivered-To: freebsd-toolchain@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B2E9F4AFC for ; Wed, 4 Sep 2019 15:18:50 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46NnXT1qjXz4RdC for ; Wed, 4 Sep 2019 15:18:48 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 6D3063C0199; Wed, 4 Sep 2019 15:18:42 +0000 (UTC) Date: Wed, 4 Sep 2019 15:18:42 +0000 From: Brooks Davis To: Sid Cc: freebsd-toolchain@freebsd.org Subject: Re: linker not using make.conf Message-ID: <20190904151842.GA71523@spindle.one-eyed-alien.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ReaqsoxgOBHFXBhH" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 46NnXT1qjXz4RdC X-Spamd-Bar: ------- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net X-Spamd-Result: default: False [-7.46 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; IP_SCORE(-3.58)[ip: (-9.32), ipnet: 199.48.128.0/22(-4.64), asn: 36236(-3.86), country: US(-0.05)]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; RCPT_COUNT_TWO(0.00)[2]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[bsdmail.com]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; SIGNED_PGP(-2.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_ZERO(0.00)[0] X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Sep 2019 15:18:50 -0000 --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 03, 2019 at 11:04:08PM +0200, Sid wrote: > In /etc/make.conf, I have > LD=3D /usr/local/bin/ld.lld80 >=20 > This is not used for ports. It may be used for building the kernel and wo= rld. >=20 > 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 in= vocation) > *** Error code 1 >=20 > XLD=3D /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 compil= er is used for ports than kernel and the base. When LD is set, XLD only app= lies when it is set as well, but this suggests that XLD is not working corr= ectly either. >=20 > 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. >=20 > I built my computer without ld in the base system, and this has worked we= ll. make.conf should reference the chosen linker without having to manually= link it. Otherwise, LD in make.conf is not working correctly, and gives th= e 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 s= et, when it's not. >=20 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 --ReaqsoxgOBHFXBhH Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJdb9XRAAoJEKzQXbSebgfA2W8H/2nRJsxmTUKyNMlnELNQKmpd 3Gv2PbcT1250V2xB5PLb1+amgOagEzJbHnHYkmknHEg+bfJyMnN3/xoKv8DyEphw SWe3GcdlJnYByMF6HArVqMx4WpkgZx3UrhzYc173wd0DC51ffgHrRzOTbIPZ1qy3 7+PbRcVCKuPIkSa1r/Od6Rt0ePkLwIQ8UC8MH0ncF617Ew0V5vQ1X8dUmqwVTjY2 l7f98iWw9nnnRNyFJSBrlAbCKQV7OqRu9xje2P+vnBVY1ObxBr7B2iGnFdJGWuoo eQCAyrNI4KQBWFgwdrtAMxpoxEdWF/At3c4GiUlS5I9+diNlagb0LAEgs5wMir4= =Xkbf -----END PGP SIGNATURE----- --ReaqsoxgOBHFXBhH--