[Midnightbsd-cvs] mports [23651] trunk/Mk/bsd.mport.mk: Add LLD_UNSAFE to force use of ld.bfd when ld is lld

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Mon Jul 23 12:50:56 EDT 2018


Revision: 23651
          http://svnweb.midnightbsd.org/mports/?rev=23651
Author:   laffer1
Date:     2018-07-23 12:50:55 -0400 (Mon, 23 Jul 2018)
Log Message:
-----------
Add LLD_UNSAFE to force use of ld.bfd when ld is lld

By default the compiler will find /usr/bin/ld for the linker.  If a port
sets LLD_UNSAFE and /usr/bin/ld is ld.lld, then add -fuse-ld=bfd to
force the use of the binutils BFD linker (from the base system, if
available, or by setting USE_BINUTILS).

Modified Paths:
--------------
    trunk/Mk/bsd.mport.mk

Modified: trunk/Mk/bsd.mport.mk
===================================================================
--- trunk/Mk/bsd.mport.mk	2018-07-23 16:03:56 UTC (rev 23650)
+++ trunk/Mk/bsd.mport.mk	2018-07-23 16:50:55 UTC (rev 23651)
@@ -650,6 +650,20 @@
 EXTRACT_DEPENDS+=	unmakeself:${PORTSDIR}/archivers/unmakeself
 .endif
 
+_TEST_LD=/usr/bin/ld
+.if defined(LLD_UNSAFE) && ${_TEST_LD:tA} == "/usr/bin/ld.lld"
+LDFLAGS+=       -fuse-ld=bfd
+.  if !defined(USE_BINUTILS)
+.    if exists(/usr/bin/ld.bfd)
+LD=     /usr/bin/ld.bfd
+CONFIGURE_ENV+= LD=${LD}
+MAKE_ENV+=      LD=${LD}
+.    else
+USE_BINUTILS=   yes
+.    endif
+.  endif
+.endif
+
 .if defined(USE_BINUTILS) && !defined(DISABLE_BINUTILS)
 BUILD_DEPENDS+=	${LOCALBASE}/bin/as:${PORTSDIR}/devel/binutils
 BINUTILS?=	ADDR2LINE AR AS CPPFILT GPROF LD NM OBJCOPY OBJDUMP RANLIB \



More information about the Midnightbsd-cvs mailing list