diff options
author | Alex Richardson <arichardson@FreeBSD.org> | 2021-09-06 08:49:49 +0000 |
---|---|---|
committer | Alex Richardson <arichardson@FreeBSD.org> | 2021-09-06 08:49:49 +0000 |
commit | 021385aba56279febcfdcc64d23673a0106ae45d (patch) | |
tree | 88139f5c95f5045080ae17623b8afcea79caedb0 /Makefile.inc1 | |
parent | 8e1c989abbd1db4dac5b2149886012d43e27b9a9 (diff) | |
download | src-021385aba56279febcfdcc64d23673a0106ae45d.tar.gz src-021385aba56279febcfdcc64d23673a0106ae45d.zip |
Add WITH_LLVM_BINUTILS to install LLVM binutils instead of Elftoolchain
When WITH_LLVM_BINUTILS is set, we will install the LLVM binutils as
ar/ranlib/nm/objcopy/etc. instead of the elftoolchain ones.
Having the LLVM binutils instead of the elftoolchain ones allows us to use
features such as LTO that depend on binutils that understand LLVM IR.
Another benefit will be an improved user-experience when compiling with
AddressSanitizer, since ASAN does not symbolize backtraces correctly if
addr2line is elftoolchain addr2line instead of llvm-symbolizer.
See https://lists.freebsd.org/archives/freebsd-toolchain/2021-July/000062.html
for more details.
This is currently off by default but will be turned on by default at some
point in the near future.
Reviewed By: emaste
Differential Revision: https://reviews.freebsd.org/D31060
Diffstat (limited to 'Makefile.inc1')
-rw-r--r-- | Makefile.inc1 | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1 index b59c1913f8ce..478824675382 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -771,6 +771,7 @@ XMAKE= ${BMAKE} \ TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ MK_CLANG_IS_CC=${MK_CLANG_BOOTSTRAP} \ MK_LLDB=no \ + MK_LLVM_BINUTILS=no \ MK_TESTS=no # kernel-tools stage @@ -2339,9 +2340,10 @@ _gensnmptree= usr.sbin/bsnmpd/gensnmptree # We need to build tblgen when we're building clang or lld, either as # bootstrap tools, or as the part of the normal build. +# llvm-tblgen is also needed for various llvm binutils (e.g. objcopy). .if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no" || \ ${MK_LLD_BOOTSTRAP} != "no" || ${MK_LLD} != "no" || \ - ${MK_LLDB} != "no" + ${MK_LLDB} != "no" || ${MK_LLVM_BINUTILS} != "no" _clang_tblgen= \ lib/clang/libllvmminimal \ usr.bin/clang/llvm-tblgen |