summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2021-05-26 11:38:51 -0700
committerKhem Raj <raj.khem@gmail.com>2021-06-08 11:37:54 -0700
commitdc5e04e5819a5e7384ae48f1740ac82970a80b8f (patch)
tree282391712013423c80f165ca09b0eef76922e774 /classes
parenta0a318157ca0555b0d6e20028dcb7e3e3f3c08c6 (diff)
downloadmeta-clang-dc5e04e5819a5e7384ae48f1740ac82970a80b8f.tar.gz
clang.bbclass: Adjust for clang default changes
Now that clang can pass right options automatically when RUNTIME = "llvm", adjust the variables e.g. COMPILER_RT/UNWINDLIB/LIBCPLUSPLUS are no more required to be defaulted Disable enforcing gcc runtime for packages using gcc as its no longer needed here but is taken care by RUNTIME variable as an aside it also helps in building native and nativesdk llvm runtimes Compute right dependencies based on selected RUNTIME along with COMPILER_RT/UNWINDLIB/LIBCPLUSPLUS variables Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'classes')
-rw-r--r--classes/clang.bbclass18
1 files changed, 11 insertions, 7 deletions
diff --git a/classes/clang.bbclass b/classes/clang.bbclass
index a56084d..4ee6c5a 100644
--- a/classes/clang.bbclass
+++ b/classes/clang.bbclass
@@ -12,17 +12,17 @@ NM_toolchain-clang = "${HOST_PREFIX}llvm-nm"
12LTO_toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'thin-lto', '-flto=thin', '-flto -fuse-ld=lld', d)}" 12LTO_toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'thin-lto', '-flto=thin', '-flto -fuse-ld=lld', d)}"
13PACKAGE_DEBUG_SPLIT_STYLE_toolchain-clang = "debug-without-src" 13PACKAGE_DEBUG_SPLIT_STYLE_toolchain-clang = "debug-without-src"
14 14
15COMPILER_RT ??= "${@bb.utils.contains("RUNTIME", "llvm", "-rtlib=compiler-rt ${UNWINDLIB}", "", d)}" 15COMPILER_RT ??= ""
16COMPILER_RT_powerpc = "-rtlib=libgcc ${UNWINDLIB}" 16COMPILER_RT_powerpc = "-rtlib=libgcc ${UNWINDLIB}"
17COMPILER_RT_armeb = "-rtlib=libgcc ${UNWINDLIB}" 17COMPILER_RT_armeb = "-rtlib=libgcc ${UNWINDLIB}"
18 18
19UNWINDLIB ??= "${@bb.utils.contains("RUNTIME", "llvm", "--unwindlib=libgcc", "", d)}" 19UNWINDLIB ??= ""
20UNWINDLIB_riscv64 = "--unwindlib=libgcc" 20UNWINDLIB_riscv64 = "--unwindlib=libgcc"
21UNWINDLIB_riscv32 = "--unwindlib=libgcc" 21UNWINDLIB_riscv32 = "--unwindlib=libgcc"
22UNWINDLIB_powerpc = "--unwindlib=libgcc" 22UNWINDLIB_powerpc = "--unwindlib=libgcc"
23UNWINDLIB_armeb = "--unwindlib=libgcc" 23UNWINDLIB_armeb = "--unwindlib=libgcc"
24 24
25LIBCPLUSPLUS ??= "${@bb.utils.contains("RUNTIME", "llvm", "-stdlib=libc++", "", d)}" 25LIBCPLUSPLUS ??= ""
26 26
27TARGET_CXXFLAGS_append_toolchain-clang = " ${LIBCPLUSPLUS}" 27TARGET_CXXFLAGS_append_toolchain-clang = " ${LIBCPLUSPLUS}"
28TUNE_CCARGS_append_toolchain-clang = " ${COMPILER_RT} ${LIBCPLUSPLUS}" 28TUNE_CCARGS_append_toolchain-clang = " ${COMPILER_RT} ${LIBCPLUSPLUS}"
@@ -69,7 +69,7 @@ LDFLAGS_append_toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is
69TOOLCHAIN ??= "gcc" 69TOOLCHAIN ??= "gcc"
70# choose between 'gnu' 'llvm' 70# choose between 'gnu' 'llvm'
71RUNTIME ??= "gnu" 71RUNTIME ??= "gnu"
72RUNTIME_toolchain-gcc = "gnu" 72#RUNTIME_toolchain-gcc = "gnu"
73RUNTIME_armeb = "gnu" 73RUNTIME_armeb = "gnu"
74 74
75TOOLCHAIN_class-native = "gcc" 75TOOLCHAIN_class-native = "gcc"
@@ -89,13 +89,17 @@ def clang_base_deps(d):
89 if not d.getVar('INHIBIT_DEFAULT_DEPS', False): 89 if not d.getVar('INHIBIT_DEFAULT_DEPS', False):
90 if not oe.utils.inherits(d, 'allarch') : 90 if not oe.utils.inherits(d, 'allarch') :
91 ret = " clang-cross-${TARGET_ARCH} virtual/libc " 91 ret = " clang-cross-${TARGET_ARCH} virtual/libc "
92 if (d.getVar('COMPILER_RT').find('-rtlib=compiler-rt') != -1): 92 if (d.getVar('RUNTIME').find('llvm') != -1):
93 ret += " compiler-rt libcxx"
94 elif (d.getVar('COMPILER_RT').find('-rtlib=compiler-rt') != -1):
93 ret += " compiler-rt " 95 ret += " compiler-rt "
94 else: 96 else:
95 ret += " libgcc " 97 ret += " libgcc "
96 if (d.getVar('COMPILER_RT').find('--unwindlib=libunwind') != -1): 98 if (d.getVar('RUNTIME').find('llvm') != -1):
99 ret += " libcxx"
100 elif (d.getVar('COMPILER_RT').find('--unwindlib=libunwind') != -1):
97 ret += " libcxx " 101 ret += " libcxx "
98 if (d.getVar('LIBCPLUSPLUS').find('-stdlib=libc++') != -1): 102 elif (d.getVar('LIBCPLUSPLUS').find('-stdlib=libc++') != -1):
99 ret += " libcxx " 103 ret += " libcxx "
100 else: 104 else:
101 ret += " virtual/${TARGET_PREFIX}compilerlibs " 105 ret += " virtual/${TARGET_PREFIX}compilerlibs "