Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Commit

Permalink
Add stack protector for GCC and clang.
Browse files Browse the repository at this point in the history
  • Loading branch information
darobs committed May 24, 2017
1 parent 526ad4d commit 0f28685
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ if(LINUX)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wformat=2 -Wformat-security ")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,-z,noexecheap -pie")
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wtrampolines")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wtrampolines")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wtrampolines -fstack-protector-all -Wstack-protector --param ssp-buffer-size=4 ")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wtrampolines -fstack-protector-all -Wstack-protector --param ssp-buffer-size=4" )
endif()
elseif(APPLE)
# Warnings as errors
set (CMAKE_C_FLAGS "-Werror ${CMAKE_C_FLAGS}")
set (CMAKE_CXX_FLAGS "-Werror ${CMAKE_CXX_FLAGS}")
set (CMAKE_C_FLAGS "-Werror ${CMAKE_C_FLAGS} -fstack-protector-all -Wstack-protector --param ssp-buffer-size=4 ")
set (CMAKE_CXX_FLAGS "-Werror ${CMAKE_CXX_FLAGS} -fstack-protector-all -Wstack-protector --param ssp-buffer-size=4 ")
endif()

function(add_module_to_solution undecoratedModuleName)
Expand Down

0 comments on commit 0f28685

Please # to comment.