From: Khem Raj Date: Mon, 12 May 2025 04:10:47 +0000 (-0700) Subject: compile-rt: Fix building compiler-native on aarch64 build hosts. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d4676d6b7c0fe40ab4f808dda436dc2f2915fd8;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git compile-rt: Fix building compiler-native on aarch64 build hosts. Using target triple confuses the native system compiler to find libgcc and C runtime during compiler-rt-native build Fixes | /home/khem/yoe/build/tmp/hosttools/ld: cannot find crtbeginS.o: No such file or directory | /home/khem/yoe/build/tmp/hosttools/ld: cannot find -lgcc: No such file or directory | /home/khem/yoe/build/tmp/hosttools/ld: cannot find -lgcc_s: No such file or directory | clang: error: linker command failed with exit code 1 (use -v to see invocation) | ninja: build stopped: subcommand failed. 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 5044db6249..ad145f8644 100644 --- a/meta/recipes-devtools/clang/compiler-rt_git.bb +++ b/meta/recipes-devtools/clang/compiler-rt_git.bb @@ -71,7 +71,6 @@ OECMAKE_TARGET_COMPILE = "compiler-rt" OECMAKE_TARGET_INSTALL = "install-compiler-rt install-compiler-rt-headers" OECMAKE_SOURCEPATH = "${S}/llvm" EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DCMAKE_C_COMPILER_TARGET=${HOST_SYS} \ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ -DCOMPILER_RT_STANDALONE_BUILD=ON \ -DCOMPILER_RT_INCLUDE_TESTS=OFF \ @@ -83,7 +82,6 @@ EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DLLVM_ENABLE_RUNTIMES='compiler-rt' \ -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ -DLLVM_APPEND_VC_REV=OFF \ - -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ -S ${S}/runtimes \ " @@ -91,6 +89,8 @@ EXTRA_OECMAKE:append:class-target = "\ -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ + -DCMAKE_C_COMPILER_TARGET=${HOST_SYS} \ + -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ " @@ -100,6 +100,8 @@ EXTRA_OECMAKE:append:class-nativesdk = "\ -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \ -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \ + -DCMAKE_C_COMPILER_TARGET=${HOST_SYS} \ + -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ " do_install:append () {