Skip to contentSkip to conversation

pkg-cmake.mk: set CMAKE_SYSROOT variable in toolchainfile.cmake

PATCH New Samuel Martin 2 participants 2 messages Aug 17, 2016 – Aug 18, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pkg-cmake.mk: set CMAKE_SYSROOT variable in toolchainfile.cmake

This change enforces the CMAKE_SYSROOT value set in the toolchainfile.cmake.

This fix overrides the CMake heuristics used to guess it, and turns off some non-desirable behavior adding "-isystem ..." flags to the compiler command line, misleading the compiler and making the build failed due to some unfound standard headers.

Fixes:
http://autobuild.buildroot.net/results/f7e/f7e92678e91a6cb15ccf32d4a7d75b39f49d6000/defconfig
(and others)

Cc Ben Boeckel <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 support/misc/toolchainfile.cmake.in | 1 +
 1 file changed, 1 insertion(+)
support/misc/toolchainfile.cmake.in +1 -0
index e550b8f..649b52d 100644
@@ -19,6 +19,7 @@ set(CMAKE_EXE_LINKER_FLAGS "@@TARGET_LDFLAGS@@ ${CMAKE_EXE_LINKER_FLAGS}" CACHE
 set(CMAKE_INSTALL_SO_NO_EXE 0)
 
 set(CMAKE_PROGRAM_PATH "${RELOCATED_HOST_DIR}/usr/bin")
+set(CMAKE_SYSROOT "${RELOCATED_HOST_DIR}/@@STAGING_SUBDIR@@")
 set(CMAKE_FIND_ROOT_PATH "${RELOCATED_HOST_DIR}/@@STAGING_SUBDIR@@")
 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
 set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/1 pkg-cmake.mk: set CMAKE_SYSROOT variable in toolchainfile.cmake

Hello,

Quoted 11 lines · Samuel Martin

This change enforces the CMAKE_SYSROOT value set in the toolchainfile.cmake.

This fix overrides the CMake heuristics used to guess it, and turns off some non-desirable behavior adding "-isystem ..." flags to the compiler command line, misleading the compiler and making the build failed due to some unfound standard headers.

Fixes:
http://autobuild.buildroot.net/results/f7e/f7e92678e91a6cb15ccf32d4a7d75b39f49d6000/defconfig
(and others)

Quoted 6 lines
Cc Ben Boeckel <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 support/misc/toolchainfile.cmake.in | 1 +
 1 file changed, 1 insertion(+)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com