svn commit: r318472 - in stable/11: . share/mk tools/build/options

Ed Maste emaste at FreeBSD.org
Thu May 18 17:40:32 UTC 2017


Author: emaste
Date: Thu May 18 17:40:30 2017
New Revision: 318472
URL: https://svnweb.freebsd.org/changeset/base/318472

Log:
  MFC LLD changes and enable LLD as /usr/bin/ld on arm64 by default
  
  MFC r316629: do not require binutils port when using lld as ld
  
  r279908 added logic to Makefile.inc1 to automatically set
  CROSS_BINUTILS_PREFIX for architectures not supported by the in-tree
  binutils: arm64 when first introduced, and later riscv64 as well.
  
  LLVM's LLD linker is now included in the base system, and is enabled by
  default for arm64 and capable of linking world and kernel. Thus, avoid
  automatically setting CROSS_BINUTILS_PREFIX and requiring the binutils
  port if WITH_LLD_IS_LD is true.
  
  --
  
  MFC r317608: revert r313473 (Disable LLD_IS_LD option combinations that fail)
  
  r316647 corrected the build of tblgen and libllvm as dependencies for
  LLD so undo the temporary seat-belt.
  
  We still want to extend the build infrastructure to automatically detect
  the case where the host LLD can be used instead of building a bootstrap
  LLD, and likely extend libllvmminimal to meet LLD's needs for cases
  where the build includes LLD but not Clang.
  
  --
  
  MFC r316684: Make WITHOUT_TOOLCHAIN imply WITHOUT_LLD.
  
  LLD is a toolchain component.
  
  --
  
  MFC r316647: Introduce LLD_BOOTSTRAP to control lld as bootstrap linker
  
  Add WITH_LLD_BOOTSTRAP and WITHOUT_LLD_BOOTSTRAP knobs, similar to the
  Clang bootstrap knobs.
  
  Reviewed by:	andrew
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D10793

Added:
  stable/11/tools/build/options/WITHOUT_LLD_BOOTSTRAP
     - copied unchanged from r316647, head/tools/build/options/WITHOUT_LLD_BOOTSTRAP
  stable/11/tools/build/options/WITH_LLD_BOOTSTRAP
     - copied unchanged from r316647, head/tools/build/options/WITH_LLD_BOOTSTRAP
Modified:
  stable/11/Makefile.inc1
  stable/11/UPDATING
  stable/11/share/mk/src.opts.mk
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/Makefile.inc1
==============================================================================
--- stable/11/Makefile.inc1	Thu May 18 17:15:58 2017	(r318471)
+++ stable/11/Makefile.inc1	Thu May 18 17:40:30 2017	(r318472)
@@ -195,10 +195,11 @@ CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN
 .endif
 # If we do not have a bootstrap binutils (because the in-tree one does not
 # support the target architecture), provide a default cross-binutils prefix.
-# This allows aarch64 builds, for example, to automatically use the
-# aarch64-binutils port or package.
+# This allows riscv64 builds, for example, to automatically use the
+# riscv64-binutils port or package.
 .if !make(showconfig)
 .if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \
+    ${MK_LLD_BOOTSTRAP} == "no" && \
     !defined(CROSS_BINUTILS_PREFIX)
 CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/
 .if !exists(${CROSS_BINUTILS_PREFIX})
@@ -1666,9 +1667,10 @@ ${_bt}-usr.bin/yacc: ${_bt}-lib/liby
 _gensnmptree=	usr.sbin/bsnmpd/gensnmptree
 .endif
 
-# We need to build tblgen when we're building clang either as
-# the bootstrap compiler, or as the part of the normal build.
-.if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no"
+# We need to build tblgen when we're building clang or lld, either as
+# bootstrap tools, or as the part of the normal build.
+.if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no" || \
+    ${MK_LLD_BOOTSTRAP} != "no" || ${MK_LLD} != "no"
 _clang_tblgen= \
 	lib/clang/libllvmminimal \
 	usr.bin/clang/llvm-tblgen \
@@ -1832,9 +1834,6 @@ _elftctools=	lib/libelftc \
 # cross-build on a FreeBSD 10 host:
 _elftctools+=	usr.bin/addr2line
 .endif
-.if ${MK_LLD_IS_LD} != "no"
-_lld=		usr.bin/clang/lld
-.endif
 .elif ${TARGET_ARCH} != ${MACHINE_ARCH} && ${MK_ELFTOOLCHAIN_BOOTSTRAP} != "no"
 # If cross-building with an external binutils we still need to build strip for
 # the target (for at least crunchide).
@@ -1845,6 +1844,11 @@ _elftctools=	lib/libelftc \
 
 .if ${MK_CLANG_BOOTSTRAP} != "no"
 _clang=		usr.bin/clang
+.endif
+.if ${MK_LLD_BOOTSTRAP} != "no"
+_lld=		usr.bin/clang/lld
+.endif
+.if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_LLD_BOOTSTRAP} != "no"
 _clang_libs=	lib/clang
 .endif
 .if ${MK_GCC_BOOTSTRAP} != "no"

Modified: stable/11/UPDATING
==============================================================================
--- stable/11/UPDATING	Thu May 18 17:15:58 2017	(r318471)
+++ stable/11/UPDATING	Thu May 18 17:40:30 2017	(r318472)
@@ -16,6 +16,12 @@ from older versions of FreeBSD, try WITH
 the tip of head, and then rebuild without this option. The bootstrap process
 from older version of current across the gcc/clang cutover is a bit fragile.
 
+20170518:
+	arm64 builds now use the base system LLD 4.0.0 linker by default,
+	instead of requiring that the aarch64-binutils port or package be
+	installed. To continue using aarch64-binutils, set
+	CROSS_BINUTILS_PREFIX=/usr/local/aarch64-freebsd/bin .
+
 20170511:
 	The mmcsd.ko module now additionally depends on geom_flashmap.ko.
 	Also, mmc.ko and mmcsd.ko need to be a matching pair built from the

Modified: stable/11/share/mk/src.opts.mk
==============================================================================
--- stable/11/share/mk/src.opts.mk	Thu May 18 17:15:58 2017	(r318471)
+++ stable/11/share/mk/src.opts.mk	Thu May 18 17:40:30 2017	(r318472)
@@ -247,9 +247,9 @@ BROKEN_OPTIONS+=TESTS   # "undefined ref
 BROKEN_OPTIONS+=CXX     # "libcxxrt.so: undefined reference to `_Unwind_Resume_or_Rethrow'"
 .endif
 .if ${__T} == "aarch64"
-__DEFAULT_YES_OPTIONS+=LLD_IS_LD
+__DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD
 .else
-__DEFAULT_NO_OPTIONS+=LLD_IS_LD
+__DEFAULT_NO_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD
 .endif
 .if ${__T} == "aarch64" || ${__T} == "amd64"
 __DEFAULT_YES_OPTIONS+=LLDB
@@ -306,16 +306,6 @@ MK_LDNS_UTILS:=	no
 MK_UNBOUND:= no
 .endif
 
-.if ${MK_LLD} == "no"
-MK_LLD_IS_LD:=	no
-.endif
-
-# LLD requires LLVM libraries, and we do not yet compare in-tree and host LLD
-# versions to avoid building it if they are identical.
-.if ${MK_LLD_IS_LD} != "no"
-MK_SYSTEM_COMPILER:=	no
-.endif
-
 .if ${MK_SOURCELESS} == "no"
 MK_SOURCELESS_HOST:=	no
 MK_SOURCELESS_UCODE:= no
@@ -383,6 +373,7 @@ MK_CLANG:=	no
 MK_GCC:=	no
 MK_GDB:=	no
 MK_INCLUDES:=	no
+MK_LLD:=	no
 MK_LLDB:=	no
 .endif
 

Copied: stable/11/tools/build/options/WITHOUT_LLD_BOOTSTRAP (from r316647, head/tools/build/options/WITHOUT_LLD_BOOTSTRAP)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/11/tools/build/options/WITHOUT_LLD_BOOTSTRAP	Thu May 18 17:40:30 2017	(r318472, copy of r316647, head/tools/build/options/WITHOUT_LLD_BOOTSTRAP)
@@ -0,0 +1,5 @@
+.\" $FreeBSD$
+Set to not build the LLD linker during the bootstrap phase of
+the build.
+To be able to build the system, either Binutils or LLD bootstrap must be
+enabled unless an alternate linker is provided via XLD.

Copied: stable/11/tools/build/options/WITH_LLD_BOOTSTRAP (from r316647, head/tools/build/options/WITH_LLD_BOOTSTRAP)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/11/tools/build/options/WITH_LLD_BOOTSTRAP	Thu May 18 17:40:30 2017	(r318472, copy of r316647, head/tools/build/options/WITH_LLD_BOOTSTRAP)
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Set to build the LLD linker during the bootstrap phase of the build.


More information about the svn-src-all mailing list