cmake.bbclass: Unset LDFLAGS for native builds
PATCH 1/1 cmake.bbclass: Unset LDFLAGS for native builds
It ends up appending LDFLAGS to CMAKE_C_LDFLAGS and CMAKE_CXX_LDFLAGS which is not good when bulding native pieces in otherwise nativesdk or target packages where LDFLAGS corresponds to them and not the native portion of building the package.
Addresses the nativesdk-clang build regression when using
TOOLCHAIN = "clang"
because clang toolchain class add dynamic linker settings to LDFLAGS which unearthed this issue
Suggested-by Ross Burton <[email protected]>
Signed-off-by Khem Raj <[email protected]>
--- meta/classes-recipe/cmake.bbclass | 1 + 1 file changed, 1 insertion(+)
meta/classes-recipe/cmake.bbclass +1 -0
@@ -181,6 +181,7 @@ list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES ${includedir}) EOF cat > ${WORKDIR}/toolchain-native.cmake <<EOF +unset( ENV{LDFLAGS} ) set( CMAKE_C_COMPILER ${OECMAKE_NATIVE_C_COMPILER} ) set( CMAKE_CXX_COMPILER ${OECMAKE_NATIVE_CXX_COMPILER} ) set( CMAKE_ASM_COMPILER ${OECMAKE_NATIVE_C_COMPILER} )