Not sure if this is useful or unnecessary bloat, it provides a way to switch back to ld.bfd on arches which default to ld.lld to switch back to ld.bfd. (It hasn't gone into a bulk yet). Thoughts?
Index: bsd.port.mk =================================================================== RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v retrieving revision 1.1450 diff -u -p -r1.1450 bsd.port.mk --- bsd.port.mk 18 Oct 2018 09:38:32 -0000 1.1450 +++ bsd.port.mk 30 Oct 2018 11:52:03 -0000 @@ -392,12 +392,6 @@ BASELOCALSTATEDIR ?= ${VARBASE} LOCALSTATEDIR ?= ${BASELOCALSTATEDIR} RCDIR ?= /etc/rc.d -USE_LLD ?= No -.if ${USE_LLD:L} == "yes" -_LD_PROGRAM = /usr/bin/ld.lld -.else -_LD_PROGRAM = /usr/bin/ld -.endif USE_WXNEEDED ?= No .if ${USE_WXNEEDED:L} == "yes" _WXNEEDED_FLAGS = -z wxneeded @@ -795,6 +789,30 @@ CONFIGURE_ENV += ${_EXTRA_ENV} MAKE_ENV += ${_EXTRA_ENV} .endif +.if ${PROPERTIES:Mlld} +USE_LLD ?= Yes +.else +USE_LLD ?= No +.endif + +.if ${USE_LLD:L} == "yes" +_LD_PROGRAM = /usr/bin/ld.lld +. if ! ${PROPERTIES:Mlld} +_NONDEFAULT_LD = Yes +. endif +.else +_LD_PROGRAM = /usr/bin/ld.bfd +. if ${PROPERTIES:Mlld} +_NONDEFAULT_LD = Yes +. endif +.endif + +.if ${_LD_PROGRAM} != ${_LD_DEFAULT} +_NONDEFAULT_LD = Yes +.else +_NONDEFAULT_LD = No +.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, # used to write wrappers to WRKDIR/bin which is at the head of the PATH. @@ -2667,7 +2685,7 @@ ${_PATCH_COOKIE}: ${_EXTRACT_COOKIE} # Run as _pbuild _post-patch-finalize: -.if ${USE_WXNEEDED:L} == "yes" || ${USE_LLD:L} == "yes" +.if ${USE_WXNEEDED:L} == "yes" || ${_NONDEFAULT_LD:L} == "yes" @wrktmp=`df -P ${WRKOBJDIR_${PKGPATH}} | awk 'END { print $$6 }'`; \ if ! mount | grep -q " $${wrktmp} .*wxallowed"; then \ echo "Fatal: ${WRKOBJDIR_${PKGPATH}} must be on a wxallowed filesystem" \