From owner-svn-src-head@freebsd.org Fri Nov 25 13:15:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F435C5448A; Fri, 25 Nov 2016 13:15:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDA6AC5C; Fri, 25 Nov 2016 13:15:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAPDFTWl029913; Fri, 25 Nov 2016 13:15:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAPDFSVL029907; Fri, 25 Nov 2016 13:15:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201611251315.uAPDFSVL029907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 25 Nov 2016 13:15:28 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Nov 2016 13:15:30 -0000 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 + 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}