diff options
author | Khem Raj <raj.khem@gmail.com> | 2019-02-08 10:07:54 -0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2019-02-09 19:27:13 -0800 |
commit | 48107e9c52b6ef16174280db582b078f687ae99f (patch) | |
tree | 0d54433fd0df6423972c70dcde3b43f4eced6431 /recipes-devtools/clang/clang_git.bb | |
parent | 00b9cd93d591099071e7087b9a354da6338dc1b7 (diff) | |
download | meta-clang-48107e9c52b6ef16174280db582b078f687ae99f.tar.gz |
clang: Enable LTO and lld based on distro knobs
Add to local.conf or distro config the following to enable lto flavors
and lld linker
DISTRO_FEATURES += "thin-lto"
DISTRO_FEATURES += "full-lto"
DISTRO_FEATURES += "lld"
Add lto.bbclass
To enable LTO is currently per recipe, or globally
to enable globally add following to global config meta-data e.g.
local.conf
INHRIT += "lto"
other-wise enable LTO per recipe using
inherit lto to recipe via bbappend or in main recipe
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'recipes-devtools/clang/clang_git.bb')
-rw-r--r-- | recipes-devtools/clang/clang_git.bb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index 63709fa..52d013d 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb | |||
@@ -43,13 +43,14 @@ def get_clang_target_arch(bb, d): | |||
43 | def get_clang_experimental_target_arch(bb, d): | 43 | def get_clang_experimental_target_arch(bb, d): |
44 | return get_clang_experimental_arch(bb, d, 'TARGET_ARCH') | 44 | return get_clang_experimental_arch(bb, d, 'TARGET_ARCH') |
45 | 45 | ||
46 | PACKAGECONFIG ??= "compiler-rt libcplusplus lto shared-libs" | 46 | PACKAGECONFIG ??= "compiler-rt libcplusplus shared-libs ${@bb.utils.filter('DISTRO_FEATURES', 'thin-lto full-lto', d)}" |
47 | PACKAGECONFIG_class-native = "lto" | 47 | PACKAGECONFIG_class-native = "thin-lto ${@bb.utils.filter('DISTRO_FEATURES', 'full-lto', d)}" |
48 | PACKAGECONFIG_class-nativesdk = "compiler-rt libcplusplus lto" | 48 | PACKAGECONFIG_class-nativesdk = "compiler-rt libcplusplus thin-lto ${@bb.utils.filter('DISTRO_FEATURES', 'full-lto', d)}" |
49 | 49 | ||
50 | PACKAGECONFIG[compiler-rt] = "-DCLANG_DEFAULT_RTLIB=compiler-rt,,compiler-rt" | 50 | PACKAGECONFIG[compiler-rt] = "-DCLANG_DEFAULT_RTLIB=compiler-rt,,compiler-rt" |
51 | PACKAGECONFIG[libcplusplus] = "-DCLANG_DEFAULT_CXX_STDLIB=libc++,,libcxx" | 51 | PACKAGECONFIG[libcplusplus] = "-DCLANG_DEFAULT_CXX_STDLIB=libc++,,libcxx" |
52 | PACKAGECONFIG[lto] = "-DLLVM_ENABLE_LTO=Thin -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils," | 52 | PACKAGECONFIG[thin-lto] = "-DLLVM_ENABLE_LTO=Thin -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils," |
53 | PACKAGECONFIG[full-lto] = "-DLLVM_ENABLE_LTO=Full -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils," | ||
53 | PACKAGECONFIG[shared-libs] = "-DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON,,," | 54 | PACKAGECONFIG[shared-libs] = "-DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON,,," |
54 | 55 | ||
55 | # | 56 | # |