Download raw body.
bsd.port.mk linker "if !exists" check and USE_LLD=ports
bsd.port.mk has this check to see whether a non-default linker exists:
----------------------------
revision 1.1468
date: 2019/05/28 20:08:17; author: naddy; state: Exp; lines: +6 -1; commitid: xn33Wb6skIgmKqtI;
When switching to a non-default linker with USE_LLD, check whether
that linker (ld.bfd, ld.lld) actually exists, otherwise skip the
port. ok jca@ sthen@
----------------------------
this was fine with linkers in the base os, but now we also support
lld from ports
----------------------------
revision 1.1626
date: 2023/09/27 08:21:06; author: semarie; state: Exp; lines: +7 -1; commitid: t7EqTUvUeFoCAazh;
extent USE_LLD to Yes/No/ports values.
'ports' permits to force the use of ld.lld from lang/clang module.
ok landry@
----------------------------
and there's a further complication now that we have both llvm 13 and
16 available; most ports are now using 16 but, on i386, lang/gcc
requires lld from llvm 13.
this typically results in the following from a bulk build:
$ grep lang/gcc/8 engine.log
35995@1704094961.28: !: lang/gcc/8 requires /usr/local/llvm13/bin/ld.lld
35995@1704094961.28: !: lang/gcc/8,-libs requires /usr/local/llvm13/bin/ld.lld
35995@1704094961.28: !: lang/gcc/8,-f95 requires /usr/local/llvm13/bin/ld.lld
35995@1704094961.38: !: math/cblas because of lang/gcc/8,-libs
35995@1704094961.52: !: math/lapack because of lang/gcc/8,-f95
35995@1704094961.61: !: lang/gcc/8,-f95 ignored already
35995@1704094961.61: !: lang/gcc/8 ignored already
35995@1704094961.62: !: lang/gcc/8,-libs ignored already
35995@1704094961.90: !: math/blas because of lang/gcc/8,-f95
35995@1704094962.08: !: lang/gcc/8,-f95 ignored already
35995@1704094962.08: !: lang/gcc/8 ignored already
35995@1704094962.09: !: lang/gcc/8,-libs ignored already
35995@1704094975.39: !: astro/wcslib because of lang/gcc/8,-f95
35995@1704094979.29: !: audio/cmu-sphinx3 because of lang/gcc/8,-f95
35995@1704094979.41: !: audio/cmu-sphinxbase because of lang/gcc/8,-libs
35995@1704095135.51: !: devel/openmpi because of lang/gcc/8,-c++
35995@1704095481.37: !: lang/compcert because of lang/gcc/8,-c++
35995@1704095554.99: !: math/R because of lang/gcc/8
35995@1704095555.98: !: math/cfitsio because of lang/gcc/8
35995@1704095560.11: !: math/hdf5 because of lang/gcc/8,-f95
35995@1704095569.74: !: math/plplot,-fortran because of lang/gcc/8
35995@1704095569.74: !: math/plplot,-main because of lang/gcc/8
35995@1704095569.75: !: math/plplot,-c++ because of lang/gcc/8
35995@1704095573.57: !: math/qrupdate because of lang/gcc/8,-libs
35995@1704095574.02: !: math/suitesparse because of lang/gcc/8,-libs
35995@1704096153.87: !: x11/kde-applications/cantor because of lang/gcc/8,-f95
35995@1704096241.69: !: lang/gcc/8 ignored already
35995@1704096241.84: !: lang/gcc/8,-f95 ignored already
35995@1704096242.33: !: lang/gcc/8,-c++ requires /usr/local/llvm13/bin/ld.lld
35995@1704096242.73: !: lang/gcc/8,-libs ignored already
and nothing with "lang/gcc/8,-f95" (i.e. gfortran) in the dependency
chain will build (e.g. numpy -> boost -> various).
Currently the only ports using USE_LLD=ports are lang/gcc/8 and
lang/gcc/11, and only on i386.
After trying many things, I think the diff below is probably the only
way to fix it (short of fixing the issues that require using llvm 13's
ld.lld for gcc).
I haven't put this through a bulk, but I _have_ done a bulk with the
IGNORE line commented-out (and not touching the !exists line) which
I think is an equivalent test, and of course boost and friends are
now getting built.
Does anyone have comments/objections or would like to OK?
Index: bsd.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
diff -u -p -r1.1636 bsd.port.mk
--- bsd.port.mk 11 Nov 2023 11:53:38 -0000 1.1636
+++ bsd.port.mk 8 Jan 2024 22:12:34 -0000
@@ -821,7 +821,7 @@ _NONDEFAULT_LD = Yes
.endif
_NONDEFAULT_LD ?= No
.if ${_NONDEFAULT_LD:L} == "yes"
-. if !exists(${_LD_PROGRAM})
+. if !exists(${_LD_PROGRAM}) && ${USE_LLD:L} != "ports"
IGNORE = "requires ${_LD_PROGRAM}"
. endif
.endif
bsd.port.mk linker "if !exists" check and USE_LLD=ports