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>
This commit is contained in:
Khem Raj 2025-05-10 15:05:42 -07:00 committed by Richard Purdie
parent 756d8ab246
commit a104d73d7a

View File

@ -58,6 +58,15 @@ BUILD_CXX = "${CCACHE}clang++ ${BUILD_CC_ARCH}"
LDFLAGS += "${COMPILER_RT} ${UNWINDLIB}"
CXXFLAGS += "${LIBCPLUSPLUS}"
def get_compiler_rt_arch(bb, d):
if bb.utils.contains('TUNE_FEATURES', 'armv5 thumb dsp', True, False, d):
return 'armv5te'
elif bb.utils.contains('TUNE_FEATURES', 'armv4 thumb', True, False, d):
return 'armv4t'
elif bb.utils.contains('TUNE_FEATURES', 'arm vfp callconvention-hard', True, False, d):
return 'armhf'
return d.getVar('HOST_ARCH')
OECMAKE_TARGET_COMPILE = "compiler-rt"
OECMAKE_TARGET_INSTALL = "install-compiler-rt install-compiler-rt-headers"
OECMAKE_SOURCEPATH = "${S}/llvm"
@ -70,7 +79,7 @@ EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCOMPILER_RT_BUILD_SANITIZERS=OFF \
-DCOMPILER_RT_BUILD_MEMPROF=OFF \
-DCOMPILER_RT_BUILD_LIBFUZZER=OFF \
-DCOMPILER_RT_DEFAULT_TARGET_ARCH=${HOST_ARCH} \
-DCOMPILER_RT_DEFAULT_TARGET_ARCH=${@get_compiler_rt_arch(bb, d)} \
-DLLVM_ENABLE_RUNTIMES='compiler-rt' \
-DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \
-DLLVM_APPEND_VC_REV=OFF \