summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/clang/common-clang.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/clang/common-clang.inc')
-rw-r--r--meta/recipes-devtools/clang/common-clang.inc23
1 files changed, 23 insertions, 0 deletions
diff --git a/meta/recipes-devtools/clang/common-clang.inc b/meta/recipes-devtools/clang/common-clang.inc
index b8f37daea2..6ac53125f0 100644
--- a/meta/recipes-devtools/clang/common-clang.inc
+++ b/meta/recipes-devtools/clang/common-clang.inc
@@ -21,4 +21,27 @@ LLVM_LIBDIR_SUFFIX = "${@d.getVar('baselib').replace('lib', '')}"
21# set the default pigz thread 21# set the default pigz thread
22export PIGZ = "-p ${@oe.utils.cpu_count(at_least=2)}" 22export PIGZ = "-p ${@oe.utils.cpu_count(at_least=2)}"
23 23
24def get_clang_arch(bb, d, arch_var):
25 import re
26 a = d.getVar(arch_var)
27 if re.match('(i.86|athlon|x86.64)$', a): return 'X86'
28 elif re.match('arm$', a): return 'ARM'
29 elif re.match('armeb$', a): return 'ARM'
30 elif re.match('aarch64$', a): return 'AArch64'
31 elif re.match('aarch64_be$', a): return 'AArch64'
32 elif re.match('mips(isa|)(32|64|)(r6|)(el|)$', a): return 'Mips'
33 elif re.match('riscv32$', a): return 'RISCV'
34 elif re.match('riscv64$', a): return 'RISCV'
35 elif re.match('p(pc|owerpc)(|64)', a): return 'PowerPC'
36 elif re.match('loongarch64$', a): return 'LoongArch'
37 else:
38 bb.fatal("Unhandled architecture %s" % arch_val)
39 return ""
40
41def get_clang_host_arch(bb, d):
42 return get_clang_arch(bb, d, 'HOST_ARCH')
43
44def get_clang_target_arch(bb, d):
45 return get_clang_arch(bb, d, 'TARGET_ARCH')
46
24require common.inc 47require common.inc