# HG changeset patch # User koda # Date 1370854789 -7200 # Node ID ecf19179b37ecb14e58fa4c61a26c8073f832e13 # Parent 7b0d5388abc4d52bcdcb7af3210c90e07ab363f9 protect all types with -fstack-protector-all diff -r 7b0d5388abc4 -r ecf19179b37e cmake_modules/compilerchecks.cmake --- a/cmake_modules/compilerchecks.cmake Mon Jun 10 10:47:59 2013 +0200 +++ b/cmake_modules/compilerchecks.cmake Mon Jun 10 10:59:49 2013 +0200 @@ -10,13 +10,13 @@ #TODO: should there be two different checks for C and CXX? #stack protection, when found it needs to go in the linker flags too (-lssp is added) -check_c_compiler_flag("-fstack-protector" HAVE_STACKPROTECTOR) +check_c_compiler_flag("-fstack-protector-all -fstack-protector" HAVE_STACKPROTECTOR) if(HAVE_STACKPROTECTOR) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fstack-protector") - set(CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -fstack-protector") - set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -fstack-protector") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-all -fstack-protector") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-all -fstack-protector") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fstack-protector-all -fstack-protector") + set(CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -fstack-protector-all -fstack-protector") + set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -fstack-protector-all -fstack-protector") endif() #symbol visibility