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:	dim
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D10249
This commit is contained in:
Ed Maste 2017-04-09 01:35:19 +00:00
parent 5850a75952
commit ffe63c8bf0
4 changed files with 19 additions and 9 deletions

View File

@ -171,7 +171,7 @@ CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX}
# riscv64-binutils port or package. # riscv64-binutils port or package.
.if !make(showconfig) .if !make(showconfig)
.if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \ .if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \
${MK_LLD_IS_LD} == "no" && \ ${MK_LLD_BOOTSTRAP} == "no" && \
!defined(CROSS_BINUTILS_PREFIX) !defined(CROSS_BINUTILS_PREFIX)
CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/ CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/
.if !exists(${CROSS_BINUTILS_PREFIX}) .if !exists(${CROSS_BINUTILS_PREFIX})
@ -1665,9 +1665,10 @@ ${_bt}-usr.bin/yacc: ${_bt}-lib/liby
_gensnmptree= usr.sbin/bsnmpd/gensnmptree _gensnmptree= usr.sbin/bsnmpd/gensnmptree
.endif .endif
# We need to build tblgen when we're building clang either as # We need to build tblgen when we're building clang or lld, either as
# the bootstrap compiler, or as the part of the normal build. # bootstrap tools, or as the part of the normal build.
.if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no" .if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no" || \
${MK_LLD_BOOTSTRAP} != "no" || ${MK_LLD} != "no"
_clang_tblgen= \ _clang_tblgen= \
lib/clang/libllvmminimal \ lib/clang/libllvmminimal \
usr.bin/clang/llvm-tblgen \ usr.bin/clang/llvm-tblgen \
@ -1828,9 +1829,6 @@ _elftctools= lib/libelftc \
# cross-build on a FreeBSD 10 host: # cross-build on a FreeBSD 10 host:
_elftctools+= usr.bin/addr2line _elftctools+= usr.bin/addr2line
.endif .endif
.if ${MK_LLD_IS_LD} != "no"
_lld= usr.bin/clang/lld
.endif
.elif ${TARGET_ARCH} != ${MACHINE_ARCH} && ${MK_ELFTOOLCHAIN_BOOTSTRAP} != "no" .elif ${TARGET_ARCH} != ${MACHINE_ARCH} && ${MK_ELFTOOLCHAIN_BOOTSTRAP} != "no"
# If cross-building with an external binutils we still need to build strip for # If cross-building with an external binutils we still need to build strip for
# the target (for at least crunchide). # the target (for at least crunchide).
@ -1841,6 +1839,11 @@ _elftctools= lib/libelftc \
.if ${MK_CLANG_BOOTSTRAP} != "no" .if ${MK_CLANG_BOOTSTRAP} != "no"
_clang= usr.bin/clang _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 _clang_libs= lib/clang
.endif .endif
.if ${MK_GCC_BOOTSTRAP} != "no" .if ${MK_GCC_BOOTSTRAP} != "no"

View File

@ -250,9 +250,9 @@ __DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND
__DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND __DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND
.endif .endif
.if ${__T} == "aarch64" .if ${__T} == "aarch64"
__DEFAULT_YES_OPTIONS+=LLD_IS_LD __DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD
.else .else
__DEFAULT_NO_OPTIONS+=LLD_IS_LD __DEFAULT_NO_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD
.endif .endif
.if ${__T} == "aarch64" || ${__T} == "amd64" .if ${__T} == "aarch64" || ${__T} == "amd64"
__DEFAULT_YES_OPTIONS+=LLDB __DEFAULT_YES_OPTIONS+=LLDB

View File

@ -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.

View File

@ -0,0 +1,2 @@
.\" $FreeBSD$
Set to build the LLD linker during the bootstrap phase of the build.