From 95d2a2fffce905235c52de19db90c766df10c9ba Mon Sep 17 00:00:00 2001 From: Gerhard Gappmeier Date: Thu, 8 Nov 2018 18:15:52 +0100 Subject: [PATCH] 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 --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9c9946a754..b1302442a8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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")