From: Khem Raj Date: Sat, 10 May 2025 22:05:42 +0000 (-0700) Subject: compiler-rt: Map the COMPILER_RT_DEFAULT_TARGET_ARCH X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71f7db2e5d264bc6ed50fae48567ae674af9a700;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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 Signed-off-by: Khem Raj Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- 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}" 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 \