diff options
author | Hsia-Jun(Randy) Li <randy.li@synaptics.com> | 2021-08-04 17:12:31 +0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2021-12-15 13:15:15 -0800 |
commit | a494bbb6ec44a723703951a061c2adde5bca6852 (patch) | |
tree | fcb87ce1a4f1040b7ba1efe912206813122bb7fd | |
parent | 0304ff4e533698a036b4df7307d0a2af29441414 (diff) | |
download | meta-clang-a494bbb6ec44a723703951a061c2adde5bca6852.tar.gz |
clang: support android runtime
Signed-off-by: Hsia-Jun(Randy) Li <randy.li@synaptics.com>
-rw-r--r-- | classes/clang.bbclass | 7 | ||||
-rw-r--r-- | conf/layer.conf | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/classes/clang.bbclass b/classes/clang.bbclass index 177a9e4..3db7036 100644 --- a/classes/clang.bbclass +++ b/classes/clang.bbclass | |||
@@ -95,15 +95,16 @@ def clang_base_deps(d): | |||
95 | if not d.getVar('INHIBIT_DEFAULT_DEPS', False): | 95 | if not d.getVar('INHIBIT_DEFAULT_DEPS', False): |
96 | if not oe.utils.inherits(d, 'allarch') : | 96 | if not oe.utils.inherits(d, 'allarch') : |
97 | ret = " clang-cross-${TARGET_ARCH} virtual/libc " | 97 | ret = " clang-cross-${TARGET_ARCH} virtual/libc " |
98 | if (d.getVar('RUNTIME').find('android') != -1): | ||
99 | ret += " libcxx" | ||
100 | return ret | ||
98 | if (d.getVar('RUNTIME').find('llvm') != -1): | 101 | if (d.getVar('RUNTIME').find('llvm') != -1): |
99 | ret += " compiler-rt libcxx" | 102 | ret += " compiler-rt libcxx" |
100 | elif (d.getVar('COMPILER_RT').find('-rtlib=compiler-rt') != -1): | 103 | elif (d.getVar('COMPILER_RT').find('-rtlib=compiler-rt') != -1): |
101 | ret += " compiler-rt " | 104 | ret += " compiler-rt " |
102 | else: | 105 | else: |
103 | ret += " libgcc " | 106 | ret += " libgcc " |
104 | if (d.getVar('RUNTIME').find('llvm') != -1): | 107 | if (d.getVar('COMPILER_RT').find('--unwindlib=libunwind') != -1): |
105 | ret += " libcxx" | ||
106 | elif (d.getVar('COMPILER_RT').find('--unwindlib=libunwind') != -1): | ||
107 | ret += " libcxx " | 108 | ret += " libcxx " |
108 | elif (d.getVar('LIBCPLUSPLUS').find('-stdlib=libc++') != -1): | 109 | elif (d.getVar('LIBCPLUSPLUS').find('-stdlib=libc++') != -1): |
109 | ret += " libcxx " | 110 | ret += " libcxx " |
diff --git a/conf/layer.conf b/conf/layer.conf index 76fb244..6a80ffc 100644 --- a/conf/layer.conf +++ b/conf/layer.conf | |||
@@ -25,7 +25,7 @@ PREFERRED_PROVIDER_libgcc-initial = "libgcc-initial" | |||
25 | PREFERRED_PROVIDER_llvm = "clang" | 25 | PREFERRED_PROVIDER_llvm = "clang" |
26 | PREFERRED_PROVIDER_llvm-native = "clang-native" | 26 | PREFERRED_PROVIDER_llvm-native = "clang-native" |
27 | PREFERRED_PROVIDER_nativesdk-llvm = "nativesdk-clang" | 27 | PREFERRED_PROVIDER_nativesdk-llvm = "nativesdk-clang" |
28 | PREFERRED_PROVIDER_libunwind = "${@bb.utils.contains("RUNTIME", "llvm", "libcxx", "libunwind", d)}" | 28 | PREFERRED_PROVIDER_libunwind = "${@bb.utils.contains_any("RUNTIME", "llvm android", "libcxx", "libunwind", d)}" |
29 | INHERIT += "clang" | 29 | INHERIT += "clang" |
30 | 30 | ||
31 | # Do not include clang in SDK unless user wants to | 31 | # Do not include clang in SDK unless user wants to |