freebsd-nq/usr.bin/clang/llvm-ar/Makefile
Alex Richardson 021385aba5 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
2021-09-06 09:49:49 +01:00

21 lines
381 B
Makefile

# $FreeBSD$
.include <src.opts.mk>
PROG_CXX= llvm-ar
MAN= llvm-ar.1 llvm-ranlib.1
SRCDIR= llvm/tools/llvm-ar
SRCS+= llvm-ar.cpp
LIBADD+= z
LINKS+= ${BINDIR}/llvm-ar ${BINDIR}/llvm-ranlib
.if ${MK_LLVM_BINUTILS} != "no"
LINKS= ${BINDIR}/llvm-ar ${BINDIR}/ar ${BINDIR}/llvm-ar ${BINDIR}/ranlib
MLINKS= llvm-ar.1 ar.1 llvm-ar.1 ranlib.1
.endif
.include "../llvm.prog.mk"