diff mbox series

[3/4] compiler-rt: Rename the rt libraries if compiled with arm hardfloat ABI

Message ID 20250508191319.3743189-3-raj.khem@gmail.com
State New
Headers show
Series [1/4] compiler-rt: Consolidate and fix cmake arguments | expand

Commit Message

Khem Raj May 8, 2025, 7:13 p.m. UTC
OE does not rely on tuple to deduce hardfloat ABI, but clang/llvm does
arm-yoe-linux-gnueabi is used for both soft and softfp and hardfp float
ABIs in OE, LLVM expects arm-yoe-linux-gnueabihf for it to be treated as
hardfloat ABI, and look for correct name for rt libraries.

We know when we compile them with Hard-float ABI so rename them in such
case so clang can find it when using -rtlib=compiler-rt it needs to
has 'armhf' suffix

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-devtools/clang/compiler-rt_git.bb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/recipes-devtools/clang/compiler-rt_git.bb b/meta/recipes-devtools/clang/compiler-rt_git.bb
index 22dec883298..0a0ef6be807 100644
--- a/meta/recipes-devtools/clang/compiler-rt_git.bb
+++ b/meta/recipes-devtools/clang/compiler-rt_git.bb
@@ -50,7 +50,6 @@  PACKAGECONFIG[ctx-profile] = "-DCOMPILER_RT_BUILD_CTX_PROFILE=ON,-DCOMPILER_RT_B
 
 HF = ""
 HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}"
-HF[vardepvalue] = "${HF}"
 
 CC = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
 CXX = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
@@ -97,6 +96,12 @@  EXTRA_OECMAKE:append:class-nativesdk = "\
 do_install:append () {
     mkdir -p ${D}${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib
     mv ${D}${nonarch_libdir}/linux ${D}${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib
+    if [ "${HF}" = "hf" ]; then
+        mv -f ${D}${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/libclang_rt.builtins-arm.a \
+              ${D}${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/libclang_rt.builtins-armhf.a
+        mv -f ${D}${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/liborc_rt-arm.a \
+              ${D}${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/liborc_rt-armhf.a
+    fi
 }
 
 FILES_SOLIBSDEV = ""