]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add WITH_LLVM_BINUTILS to install LLVM binutils instead of Elftoolchain
authorAlex Richardson <arichardson@FreeBSD.org>
Mon, 6 Sep 2021 08:49:49 +0000 (09:49 +0100)
committerAlex Richardson <arichardson@FreeBSD.org>
Mon, 6 Sep 2021 08:49:49 +0000 (09:49 +0100)
commit021385aba56279febcfdcc64d23673a0106ae45d
tree88139f5c95f5045080ae17623b8afcea79caedb0
parent8e1c989abbd1db4dac5b2149886012d43e27b9a9
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
14 files changed:
Makefile.inc1
lib/Makefile
lib/clang/Makefile
lib/clang/libllvm/Makefile
share/mk/src.opts.mk
tools/build/options/WITH_LLVM_BINUTILS [new file with mode: 0644]
usr.bin/Makefile
usr.bin/clang/Makefile
usr.bin/clang/llvm-ar/Makefile
usr.bin/clang/llvm-nm/Makefile
usr.bin/clang/llvm-objcopy/Makefile
usr.bin/clang/llvm-objdump/Makefile
usr.bin/clang/llvm-size/Makefile
usr.bin/clang/llvm-symbolizer/Makefile