]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add support for selectively enabling LLVM targets
authorDimitry Andric <dim@FreeBSD.org>
Fri, 22 Jun 2018 15:00:00 +0000 (15:00 +0000)
committerDimitry Andric <dim@FreeBSD.org>
Fri, 22 Jun 2018 15:00:00 +0000 (15:00 +0000)
commitcbafd2630b811d90130261b97421f246d8ea2a50
treec7023b0e92ac34a32f2af9ef17494c8d4808c3a5
parent7e8db78116c568e5282a1543318ec283c08fe5ba
Add support for selectively enabling LLVM targets

This makes it possible, through src.conf(5) settings, to select which
LLVM targets you want to build during buildworld.  The current list is:

* (WITH|WITHOUT)_LLVM_TARGET_AARCH64
* (WITH|WITHOUT)_LLVM_TARGET_ARM
* (WITH|WITHOUT)_LLVM_TARGET_MIPS
* (WITH|WITHOUT)_LLVM_TARGET_POWERPC
* (WITH|WITHOUT)_LLVM_TARGET_SPARC
* (WITH|WITHOUT)_LLVM_TARGET_X86

To not influence anything right now, all of these are on by default, in
situations where clang is enabled.

Selectively turning a few targets off manually should work.  Turning on
only one target should work too, even if that target does not correspond
to the build architecture.  (In that case, LLVM_NATIVE_ARCH will not be
defined, and you can only use the resulting clang executable for
cross-compiling.)

I performed a few measurements on one of the FreeBSD.org reference
machines, building clang from scratch, with all targets enabled, and
with only the x86 target enabled.  The latter was ~12% faster in real
time (on a 32-core box), and ~14% faster in user time.  For a full
buildworld the difference will probably be less pronounced, though.

Reviewed by: bdrewery
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11077
21 files changed:
lib/clang/include/llvm/Config/AsmParsers.def
lib/clang/include/llvm/Config/AsmPrinters.def
lib/clang/include/llvm/Config/Disassemblers.def
lib/clang/include/llvm/Config/Targets.def
lib/clang/include/llvm/Config/llvm-config.h
lib/clang/libllvm/Makefile
lib/clang/llvm.build.mk
share/man/man5/src.conf.5
share/mk/src.opts.mk
tools/build/options/WITHOUT_LLVM_TARGET_AARCH64 [new file with mode: 0644]
tools/build/options/WITHOUT_LLVM_TARGET_ARM [new file with mode: 0644]
tools/build/options/WITHOUT_LLVM_TARGET_MIPS [new file with mode: 0644]
tools/build/options/WITHOUT_LLVM_TARGET_POWERPC [new file with mode: 0644]
tools/build/options/WITHOUT_LLVM_TARGET_SPARC [new file with mode: 0644]
tools/build/options/WITHOUT_LLVM_TARGET_X86 [new file with mode: 0644]
tools/build/options/WITH_LLVM_TARGET_AARCH64 [new file with mode: 0644]
tools/build/options/WITH_LLVM_TARGET_ARM [new file with mode: 0644]
tools/build/options/WITH_LLVM_TARGET_MIPS [new file with mode: 0644]
tools/build/options/WITH_LLVM_TARGET_POWERPC [new file with mode: 0644]
tools/build/options/WITH_LLVM_TARGET_SPARC [new file with mode: 0644]
tools/build/options/WITH_LLVM_TARGET_X86 [new file with mode: 0644]