summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHsia-Jun(Randy) Li <randy.li@synaptics.com>2021-08-04 17:12:31 +0800
committerKhem Raj <raj.khem@gmail.com>2023-09-08 09:08:54 -0700
commitd84a47dd3906a0bbe1e373b3725df0f0c53d7089 (patch)
tree37c9cbe33c6bb73a15fe1e9e5166b9c81925b92d
parent659b1a34842f9e0b1e2522a7badab2bd4c20ad82 (diff)
downloadmeta-clang-d84a47dd3906a0bbe1e373b3725df0f0c53d7089.tar.gz
clang: support android runtime
Signed-off-by: Hsia-Jun(Randy) Li <randy.li@synaptics.com> (cherry picked from commit a494bbb6ec44a723703951a061c2adde5bca6852)
-rw-r--r--classes/clang.bbclass7
-rw-r--r--conf/layer.conf2
2 files changed, 5 insertions, 4 deletions
diff --git a/classes/clang.bbclass b/classes/clang.bbclass
index 91f4da3..7ad5ccb 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 fdfb836..0736baf 100644
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -28,7 +28,7 @@ PREFERRED_PROVIDER_libgcc-initial = "libgcc-initial"
28PREFERRED_PROVIDER_llvm = "clang" 28PREFERRED_PROVIDER_llvm = "clang"
29PREFERRED_PROVIDER_llvm-native = "clang-native" 29PREFERRED_PROVIDER_llvm-native = "clang-native"
30PREFERRED_PROVIDER_nativesdk-llvm = "nativesdk-clang" 30PREFERRED_PROVIDER_nativesdk-llvm = "nativesdk-clang"
31PREFERRED_PROVIDER_libunwind = "${@bb.utils.contains("RUNTIME", "llvm", "libcxx", "libunwind", d)}" 31PREFERRED_PROVIDER_libunwind = "${@bb.utils.contains_any("RUNTIME", "llvm android", "libcxx", "libunwind", d)}"
32INHERIT += "clang" 32INHERIT += "clang"
33 33
34# Do not include clang in SDK unless user wants to 34# Do not include clang in SDK unless user wants to