]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
build: disable stack protection on Windows
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Tue, 23 Jun 2020 09:00:54 +0000 (09:00 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Wed, 18 Nov 2020 10:31:24 +0000 (10:31 +0000)
Passing "-fstack-protector-strong" doesn't seem to work with Mingw,
complaining about undefied "__stack_chk_fail". For this reason,
we'll disable it for now.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
src/CMakeLists.txt

index b8110eab6216c4d001bf84b51d0c8cf06ab156bd..2af3f66e3d4163280be58a24e0501ee6c39b1136 100644 (file)
@@ -126,10 +126,12 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
         -D_FORTIFY_SOURCE=2)
     endif()
   endif()
-  CHECK_C_COMPILER_FLAG(-fstack-protector-strong HAS_STACK_PROTECT)
-  if (HAS_STACK_PROTECT)
-    add_compile_options(-fstack-protector-strong)
-  endif()
+  if(NOT WIN32)
+    CHECK_C_COMPILER_FLAG(-fstack-protector-strong HAS_STACK_PROTECT)
+    if (HAS_STACK_PROTECT)
+      add_compile_options(-fstack-protector-strong)
+    endif()
+  endif(NOT WIN32)
 endif(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
 
 CHECK_C_COMPILER_FLAG("-D_GLIBCXX_ASSERTIONS" HAS_GLIBCXX_ASSERTIONS)