]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
classes/cmake: unset LDFLAGS in toolchain-native.bbclass
authorRoss Burton <ross.burton@arm.com>
Fri, 26 Sep 2025 14:33:39 +0000 (15:33 +0100)
committerMathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Fri, 26 Sep 2025 15:06:51 +0000 (17:06 +0200)
commitbf191c794858c1c979aec00a60f882d035d29bdb
tree47e30b0c265f885f6d21bb0680d6d208cbbf1e8d
parent4c73fd51b59b1262ceadd23b9d11fcb6c2f4ca8a
classes/cmake: unset LDFLAGS in toolchain-native.bbclass

If a recipe is using toolchain-native.cmake to build native portion in a
non-native build, the target LDFLAGS from the environment will leak into
the native build.

This was noticed as building a SDK with clang means that LDFLAGS contains
a --dynamic-loader argument, so native binaries were trying to use the
target loader.

There are several variables that are set from LDFLAGS[1] so instead of
setting them all, we can simply unset the environment variable in the
toolchain.

[1] https://cmake.org/cmake/help/latest/envvar/LDFLAGS.html

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
meta/classes-recipe/cmake.bbclass