From: Ross Burton Date: Fri, 1 Aug 2025 12:55:18 +0000 (+0100) Subject: libclc: do native build of prepare_builtins in a fresh environment X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=0013f501d1de01606b812d930ef6ca842633f551;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git libclc: do native build of prepare_builtins in a fresh environment The environment has variables like LDFLAGS set which CMake will try and use, so until our cmake class is comprehensive enough to nuke those in the native toolchain file (if that is possible) do a build inside a clean (apart from PATH) environment to avoid cross-contamination. As noticed by Khem Raj, this can fail in nativesdk builds as the target flags will be passed to the native link resulting in failures like: Requesting program interpreter: /usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-yoesdk-linux/lib/ld-linux-x86-64.so.2 Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-devtools/clang/libclc_git.bb b/meta/recipes-devtools/clang/libclc_git.bb index 04b76c55d2..e56cf2eb6c 100644 --- a/meta/recipes-devtools/clang/libclc_git.bb +++ b/meta/recipes-devtools/clang/libclc_git.bb @@ -28,7 +28,7 @@ EXTRA_OECMAKE:append:class-nativesdk = " -DPREPARE_BUILTINS=${B_NATIVE}/prepare_ # Need to build a native prepare_builtins binary in target builds. The easiest # way to do this is with a second native cmake build tree. do_build_prepare_builtins() { - cmake --fresh -G Ninja \ + env -i PATH=$PATH cmake --fresh -G Ninja \ -S ${OECMAKE_SOURCEPATH} -B ${B_NATIVE} \ -DCMAKE_TOOLCHAIN_FILE:FILEPATH=${WORKDIR}/toolchain-native.cmake \ -DLIBCLC_TARGETS_TO_BUILD=