Enable stack protect and fpic/fpie for host

This commit is contained in:
Senthil 2016-05-04 21:09:42 -07:00
parent c0aeb91d61
commit 1670ffbc3d
4 changed files with 9 additions and 0 deletions

View file

@ -8,6 +8,8 @@ if(WIN32)
add_compile_options($<$<CONFIG:RelWithDebInfo>:/MT>)
add_compile_options($<$<CONFIG:Release>:/MT>)
add_compile_options($<$<CONFIG:Debug>:/MTd>)
else()
add_compile_options(-fPIE)
endif()
include(setup.cmake)

View file

@ -8,6 +8,8 @@ if(WIN32)
add_compile_options($<$<CONFIG:RelWithDebInfo>:/MT>)
add_compile_options($<$<CONFIG:Release>:/MT>)
add_compile_options($<$<CONFIG:Debug>:/MTd>)
else()
add_compile_options(-fPIC)
endif()
include(../setup.cmake)

View file

@ -8,6 +8,8 @@ if(WIN32)
add_compile_options($<$<CONFIG:RelWithDebInfo>:/MT>)
add_compile_options($<$<CONFIG:Release>:/MT>)
add_compile_options($<$<CONFIG:Debug>:/MTd>)
else()
add_compile_options(-fPIC)
endif()
include(../setup.cmake)

View file

@ -43,6 +43,9 @@ endif()
# containing the reference instead of using definitions from other modules.
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic -Bsymbolic-functions")
add_compile_options(-fstack-protector-strong)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
add_compile_options(-fstack-protector)
endif()
if(CLI_CMAKE_PLATFORM_ARCH_I386)