Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Nov 2016 13:15:28 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r309142 - in head: . gnu/usr.bin/binutils/ld share/mk tools/build/options usr.bin/clang/lld
Message-ID:  <201611251315.uAPDFSVL029907@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Fri Nov 25 13:15:28 2016
New Revision: 309142
URL: https://svnweb.freebsd.org/changeset/base/309142

Log:
  Add WITH_LLD_AS_LD build knob
  
  If set it installs LLD as /usr/bin/ld.  LLD (as of version 3.9) is not
  capable of linking the world and kernel, but can self-host and link many
  substantial applications. GNU ld continues to be used for the world and
  kernel build, regardless of how this knob is set.
  
  It is on by default for arm64, and off for all other CPU architectures.
  
  Sponsored by:	The FreeBSD Foundation

Added:
  head/tools/build/options/WITHOUT_LLD_AS_LD   (contents, props changed)
  head/tools/build/options/WITH_LLD_AS_LD   (contents, props changed)
Modified:
  head/Makefile.inc1
  head/gnu/usr.bin/binutils/ld/Makefile
  head/share/mk/src.opts.mk
  head/usr.bin/clang/lld/Makefile

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Fri Nov 25 10:40:48 2016	(r309141)
+++ head/Makefile.inc1	Fri Nov 25 13:15:28 2016	(r309142)
@@ -516,7 +516,7 @@ TMAKE=		MAKEOBJDIRPREFIX=${OBJTREE} \
 # cross-tools stage
 XMAKE=		TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \
 		TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
-		MK_GDB=no MK_TESTS=no
+		MK_GDB=no MK_TESTS=no MK_LLD_AS_LD=no
 
 # kernel-tools stage
 KTMAKEENV=	INSTALL="sh ${.CURDIR}/tools/install.sh" \

Modified: head/gnu/usr.bin/binutils/ld/Makefile
==============================================================================
--- head/gnu/usr.bin/binutils/ld/Makefile	Fri Nov 25 10:40:48 2016	(r309141)
+++ head/gnu/usr.bin/binutils/ld/Makefile	Fri Nov 25 13:15:28 2016	(r309142)
@@ -49,7 +49,9 @@ CLEANFILES+=	ldemul-list.h stringify.sed
 
 FILES=		${LDSCRIPTS:S|^|ldscripts/|}
 FILESDIR=	${SCRIPTDIR}
+.if ${MK_LLD_AS_LD} == "no"
 LINKS=		${BINDIR}/ld.bfd ${BINDIR}/ld
+.endif
 
 HOST=		${TARGET_TUPLE}
 LIBSEARCHPATH=	\"=/lib\":\"=/usr/lib\"

Modified: head/share/mk/src.opts.mk
==============================================================================
--- head/share/mk/src.opts.mk	Fri Nov 25 10:40:48 2016	(r309141)
+++ head/share/mk/src.opts.mk	Fri Nov 25 13:15:28 2016	(r309142)
@@ -250,6 +250,11 @@ __DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND
 .else
 __DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND
 .endif
+.if ${__T} == "aarch64"
+__DEFAULT_YES_OPTIONS+=LLD_AS_LD
+.else
+__DEFAULT_NO_OPTIONS+=LLD_AS_LD
+.endif
 .if ${__T} == "aarch64" || ${__T} == "amd64"
 __DEFAULT_YES_OPTIONS+=LLD LLDB
 .else

Added: head/tools/build/options/WITHOUT_LLD_AS_LD
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/build/options/WITHOUT_LLD_AS_LD	Fri Nov 25 13:15:28 2016	(r309142)
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Set to use GNU binutils ld as the system linker, instead of LLVM's LLD.

Added: head/tools/build/options/WITH_LLD_AS_LD
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/build/options/WITH_LLD_AS_LD	Fri Nov 25 13:15:28 2016	(r309142)
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Set to use LLVM's LLD as the system linker, instead of GNU binutils ld.

Modified: head/usr.bin/clang/lld/Makefile
==============================================================================
--- head/usr.bin/clang/lld/Makefile	Fri Nov 25 10:40:48 2016	(r309141)
+++ head/usr.bin/clang/lld/Makefile	Fri Nov 25 13:15:28 2016	(r309142)
@@ -1,10 +1,15 @@
 # $FreeBSD$
 
+.include <src.opts.mk>
+
 LLVM_SRCS=	${SRCTOP}/contrib/llvm
 LLD_SRCS=	${LLVM_SRCS}/tools/lld
 
 PROG_CXX=	ld.lld
 MAN=
+.if ${MK_LLD_AS_LD} != "no"
+SYMLINKS=	${PROG_CXX} ${BINDIR}/ld
+.endif
 
 CFLAGS+=	-I${LLD_SRCS}/include
 CFLAGS+=	-I${.OBJDIR}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611251315.uAPDFSVL029907>