diff options
author | Khem Raj <raj.khem@gmail.com> | 2025-05-10 15:05:42 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-05-15 10:55:26 +0100 |
commit | a104d73d7a3ff56448432d9beab895aaaba8ed8b (patch) | |
tree | 93b7ee175f1cc20fdc2b118d5b3c027d41096661 | |
parent | 756d8ab24651a66f3ec705ab57a86a3919468cd2 (diff) | |
download | poky-a104d73d7a3ff56448432d9beab895aaaba8ed8b.tar.gz |
compiler-rt: Map the COMPILER_RT_DEFAULT_TARGET_ARCH
COMPILER_RT_DEFAULT_TARGET_ARCH is not 1 to 1 match with HOST_ARCH
especially for armv5/arm4
(From OE-Core rev: 71f7db2e5d264bc6ed50fae48567ae674af9a700)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-devtools/clang/compiler-rt_git.bb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/meta/recipes-devtools/clang/compiler-rt_git.bb b/meta/recipes-devtools/clang/compiler-rt_git.bb index 0a0ef6be80..5044db6249 100644 --- a/meta/recipes-devtools/clang/compiler-rt_git.bb +++ b/meta/recipes-devtools/clang/compiler-rt_git.bb | |||
@@ -58,6 +58,15 @@ BUILD_CXX = "${CCACHE}clang++ ${BUILD_CC_ARCH}" | |||
58 | LDFLAGS += "${COMPILER_RT} ${UNWINDLIB}" | 58 | LDFLAGS += "${COMPILER_RT} ${UNWINDLIB}" |
59 | CXXFLAGS += "${LIBCPLUSPLUS}" | 59 | CXXFLAGS += "${LIBCPLUSPLUS}" |
60 | 60 | ||
61 | def get_compiler_rt_arch(bb, d): | ||
62 | if bb.utils.contains('TUNE_FEATURES', 'armv5 thumb dsp', True, False, d): | ||
63 | return 'armv5te' | ||
64 | elif bb.utils.contains('TUNE_FEATURES', 'armv4 thumb', True, False, d): | ||
65 | return 'armv4t' | ||
66 | elif bb.utils.contains('TUNE_FEATURES', 'arm vfp callconvention-hard', True, False, d): | ||
67 | return 'armhf' | ||
68 | return d.getVar('HOST_ARCH') | ||
69 | |||
61 | OECMAKE_TARGET_COMPILE = "compiler-rt" | 70 | OECMAKE_TARGET_COMPILE = "compiler-rt" |
62 | OECMAKE_TARGET_INSTALL = "install-compiler-rt install-compiler-rt-headers" | 71 | OECMAKE_TARGET_INSTALL = "install-compiler-rt install-compiler-rt-headers" |
63 | OECMAKE_SOURCEPATH = "${S}/llvm" | 72 | OECMAKE_SOURCEPATH = "${S}/llvm" |
@@ -70,7 +79,7 @@ EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |||
70 | -DCOMPILER_RT_BUILD_SANITIZERS=OFF \ | 79 | -DCOMPILER_RT_BUILD_SANITIZERS=OFF \ |
71 | -DCOMPILER_RT_BUILD_MEMPROF=OFF \ | 80 | -DCOMPILER_RT_BUILD_MEMPROF=OFF \ |
72 | -DCOMPILER_RT_BUILD_LIBFUZZER=OFF \ | 81 | -DCOMPILER_RT_BUILD_LIBFUZZER=OFF \ |
73 | -DCOMPILER_RT_DEFAULT_TARGET_ARCH=${HOST_ARCH} \ | 82 | -DCOMPILER_RT_DEFAULT_TARGET_ARCH=${@get_compiler_rt_arch(bb, d)} \ |
74 | -DLLVM_ENABLE_RUNTIMES='compiler-rt' \ | 83 | -DLLVM_ENABLE_RUNTIMES='compiler-rt' \ |
75 | -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ | 84 | -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ |
76 | -DLLVM_APPEND_VC_REV=OFF \ | 85 | -DLLVM_APPEND_VC_REV=OFF \ |