]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
compiler-rt: Rename the rt libraries if compiled with arm hardfloat ABI
authorKhem Raj <raj.khem@gmail.com>
Thu, 8 May 2025 19:13:18 +0000 (12:13 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 12 May 2025 21:01:25 +0000 (22:01 +0100)
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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/clang/compiler-rt_git.bb

index 22dec883298e03a2e790037ff15fbe648bb4c7b2..0a0ef6be807d4cad5e6710ade3febc3c49b46846 100644 (file)
@@ -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 = ""