]> 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)
committerDimitry Andric <dim@FreeBSD.org>
Sun, 5 Dec 2021 20:42:14 +0000 (21:42 +0100)
commita5186406aced401de7984f8b338675da650d0e25
tree38249f3706fda4191a0b4cffd04d7c4b5db872b2
parent0c5f290ed90963b64b05a2098e0b11c3d9f6471f
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

(cherry picked from commit 021385aba56279febcfdcc64d23673a0106ae45d)
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