summaryrefslogtreecommitdiffstats
path: root/classes/clang.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'classes/clang.bbclass')
-rw-r--r--classes/clang.bbclass17
1 files changed, 12 insertions, 5 deletions
diff --git a/classes/clang.bbclass b/classes/clang.bbclass
index 75c9d4a..99b80a4 100644
--- a/classes/clang.bbclass
+++ b/classes/clang.bbclass
@@ -9,6 +9,7 @@ AR_toolchain-clang = "${HOST_PREFIX}llvm-ar"
9NM_toolchain-clang = "${HOST_PREFIX}llvm-nm" 9NM_toolchain-clang = "${HOST_PREFIX}llvm-nm"
10 10
11COMPILER_RT ??= "--rtlib=compiler-rt ${UNWINDLIB}" 11COMPILER_RT ??= "--rtlib=compiler-rt ${UNWINDLIB}"
12COMPILER_RT_toolchain-gcc = ""
12COMPILER_RT_powerpc = "--rtlib=libgcc ${UNWINDLIB}" 13COMPILER_RT_powerpc = "--rtlib=libgcc ${UNWINDLIB}"
13 14
14UNWINDLIB ??= "--unwindlib=libunwind" 15UNWINDLIB ??= "--unwindlib=libunwind"
@@ -17,8 +18,6 @@ UNWINDLIB_riscv32 = "--unwindlib=libgcc"
17UNWINDLIB_powerpc = "--unwindlib=libgcc" 18UNWINDLIB_powerpc = "--unwindlib=libgcc"
18 19
19LIBCPLUSPLUS ??= "--stdlib=libc++" 20LIBCPLUSPLUS ??= "--stdlib=libc++"
20
21COMPILER_RT_toolchain-gcc = ""
22LIBCPLUSPLUS_toolchain-gcc = "" 21LIBCPLUSPLUS_toolchain-gcc = ""
23 22
24TARGET_CXXFLAGS_append_toolchain-clang = " ${LIBCPLUSPLUS}" 23TARGET_CXXFLAGS_append_toolchain-clang = " ${LIBCPLUSPLUS}"
@@ -64,11 +63,19 @@ OVERRIDES[vardepsexclude] += "TOOLCHAIN"
64def clang_dep_prepend(d): 63def clang_dep_prepend(d):
65 if not d.getVar('INHIBIT_DEFAULT_DEPS', False): 64 if not d.getVar('INHIBIT_DEFAULT_DEPS', False):
66 if not oe.utils.inherits(d, 'allarch') : 65 if not oe.utils.inherits(d, 'allarch') :
67 return " clang-cross-${TARGET_ARCH} compiler-rt libcxx" 66 ret = " clang-cross-${TARGET_ARCH} virtual/libc "
67 if (d.getVar('COMPILER_RT').find('--rtlib=compiler-rt') != -1):
68 ret += " compiler-rt "
69 else:
70 ret += " libgcc "
71 if (d.getVar('LIBCPLUSPLUS').find('--stdlib=libc++') != -1):
72 ret += " libcxx "
73 else:
74 ret += " virtual/${TARGET_PREFIX}compilerlibs "
75 return ret
68 return "" 76 return ""
69 77
70BASEDEPENDS_remove_toolchain-clang_class-target = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs" 78BASE_DEFAULT_DEPS_toolchain-clang_class-target = "${@clang_dep_prepend(d)}"
71BASEDEPENDS_append_toolchain-clang_class-target = "${@clang_dep_prepend(d)}"
72 79
73PREFERRED_PROVIDER_libunwind_toolchain-clang = "libcxx" 80PREFERRED_PROVIDER_libunwind_toolchain-clang = "libcxx"
74PREFERRED_PROVIDER_libunwind ?= "libunwind" 81PREFERRED_PROVIDER_libunwind ?= "libunwind"