diff options
Diffstat (limited to 'classes')
-rw-r--r-- | classes/clang.bbclass | 17 |
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" | |||
9 | NM_toolchain-clang = "${HOST_PREFIX}llvm-nm" | 9 | NM_toolchain-clang = "${HOST_PREFIX}llvm-nm" |
10 | 10 | ||
11 | COMPILER_RT ??= "--rtlib=compiler-rt ${UNWINDLIB}" | 11 | COMPILER_RT ??= "--rtlib=compiler-rt ${UNWINDLIB}" |
12 | COMPILER_RT_toolchain-gcc = "" | ||
12 | COMPILER_RT_powerpc = "--rtlib=libgcc ${UNWINDLIB}" | 13 | COMPILER_RT_powerpc = "--rtlib=libgcc ${UNWINDLIB}" |
13 | 14 | ||
14 | UNWINDLIB ??= "--unwindlib=libunwind" | 15 | UNWINDLIB ??= "--unwindlib=libunwind" |
@@ -17,8 +18,6 @@ UNWINDLIB_riscv32 = "--unwindlib=libgcc" | |||
17 | UNWINDLIB_powerpc = "--unwindlib=libgcc" | 18 | UNWINDLIB_powerpc = "--unwindlib=libgcc" |
18 | 19 | ||
19 | LIBCPLUSPLUS ??= "--stdlib=libc++" | 20 | LIBCPLUSPLUS ??= "--stdlib=libc++" |
20 | |||
21 | COMPILER_RT_toolchain-gcc = "" | ||
22 | LIBCPLUSPLUS_toolchain-gcc = "" | 21 | LIBCPLUSPLUS_toolchain-gcc = "" |
23 | 22 | ||
24 | TARGET_CXXFLAGS_append_toolchain-clang = " ${LIBCPLUSPLUS}" | 23 | TARGET_CXXFLAGS_append_toolchain-clang = " ${LIBCPLUSPLUS}" |
@@ -64,11 +63,19 @@ OVERRIDES[vardepsexclude] += "TOOLCHAIN" | |||
64 | def clang_dep_prepend(d): | 63 | def 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 | ||
70 | BASEDEPENDS_remove_toolchain-clang_class-target = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs" | 78 | BASE_DEFAULT_DEPS_toolchain-clang_class-target = "${@clang_dep_prepend(d)}" |
71 | BASEDEPENDS_append_toolchain-clang_class-target = "${@clang_dep_prepend(d)}" | ||
72 | 79 | ||
73 | PREFERRED_PROVIDER_libunwind_toolchain-clang = "libcxx" | 80 | PREFERRED_PROVIDER_libunwind_toolchain-clang = "libcxx" |
74 | PREFERRED_PROVIDER_libunwind ?= "libunwind" | 81 | PREFERRED_PROVIDER_libunwind ?= "libunwind" |