Disable stack protector features when cross compiling
authorGerhard Gappmeier <gerhard.gappmeier@ascolab.com>
Thu, 8 Nov 2018 17:15:52 +0000 (18:15 +0100)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:58:18 +0000 (10:58 +0100)
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

index b3658c98bc8355c7e726393172520ba3cb1de2f1..69c9cfde3cbe7d3808a11c659796350c127621a9 100644 (file)
@@ -13,7 +13,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")