On Tue, May 28 2019, Christian Weisgerber <na...@mips.inka.de> wrote: > Jeremie Courreges-Anglas: > >> So far we only need this for one arch, maybe a cheaper approach would be >> enough? The diff below just tests whether ld.bfd exists. > > On archs other than LLD_ARCHS, that diff would stat() ld.bfd every > time bsd.port.mk is parsed. > > Let's do this only when USE_LLD switches to the non-default linker > and check for either ld.bfd or ld.lld. Everything is already set > up for this. > > OK?
That looks much nicer indeed. ok jca@ > Index: bsd.port.mk > =================================================================== > RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v > retrieving revision 1.1467 > diff -u -p -r1.1467 bsd.port.mk > --- bsd.port.mk 20 May 2019 22:15:13 -0000 1.1467 > +++ bsd.port.mk 28 May 2019 10:45:52 -0000 > @@ -809,6 +809,11 @@ _NONDEFAULT_LD = Yes > . endif > .endif > _NONDEFAULT_LD ?= No > +.if ${_NONDEFAULT_LD:L} == "yes" > +. if !exists(${_LD_PROGRAM}) > +IGNORE = "requires ${_LD_PROGRAM}" > +. endif > +.endif > > # setup locations of compilers from the base system or environment variables. > # MODULES for compilers (gcc4.port.mk, clang.port.mk) also append to this, -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE