Disable stack protector features when cross compiling

When cross-compiling this for remarkable using the poky toolchain
this results in linker errors with stack protector: libssp_nonshared.a
not found
This commit is contained in:
Gerhard Gappmeier 2018-11-08 18:15:52 +01:00
parent e0841e4958
commit 95d2a2fffc

View File

@ -15,7 +15,7 @@ if(NOT TOKEN_AUTH_ONLY)
endif()
if(NOT MSVC)
if(NOT (CMAKE_SYSTEM_PROCESSOR MATCHES "^(alpha|parisc|hppa)"))
if(NOT (CMAKE_SYSTEM_PROCESSOR MATCHES "^(alpha|parisc|hppa)") AND NOT CMAKE_CROSSCOMPILING)
if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9))
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector --param=ssp-buffer-size=4")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector --param=ssp-buffer-size=4")