Merge pull request #2900 from schellap/fpie
Enable stack protect and fpic/fpie for host
This commit is contained in:
commit
3df46ec070
4 changed files with 9 additions and 0 deletions
|
@ -8,6 +8,8 @@ if(WIN32)
|
||||||
add_compile_options($<$<CONFIG:RelWithDebInfo>:/MT>)
|
add_compile_options($<$<CONFIG:RelWithDebInfo>:/MT>)
|
||||||
add_compile_options($<$<CONFIG:Release>:/MT>)
|
add_compile_options($<$<CONFIG:Release>:/MT>)
|
||||||
add_compile_options($<$<CONFIG:Debug>:/MTd>)
|
add_compile_options($<$<CONFIG:Debug>:/MTd>)
|
||||||
|
else()
|
||||||
|
add_compile_options(-fPIE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(setup.cmake)
|
include(setup.cmake)
|
||||||
|
|
|
@ -8,6 +8,8 @@ if(WIN32)
|
||||||
add_compile_options($<$<CONFIG:RelWithDebInfo>:/MT>)
|
add_compile_options($<$<CONFIG:RelWithDebInfo>:/MT>)
|
||||||
add_compile_options($<$<CONFIG:Release>:/MT>)
|
add_compile_options($<$<CONFIG:Release>:/MT>)
|
||||||
add_compile_options($<$<CONFIG:Debug>:/MTd>)
|
add_compile_options($<$<CONFIG:Debug>:/MTd>)
|
||||||
|
else()
|
||||||
|
add_compile_options(-fPIC)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(../setup.cmake)
|
include(../setup.cmake)
|
||||||
|
|
|
@ -8,6 +8,8 @@ if(WIN32)
|
||||||
add_compile_options($<$<CONFIG:RelWithDebInfo>:/MT>)
|
add_compile_options($<$<CONFIG:RelWithDebInfo>:/MT>)
|
||||||
add_compile_options($<$<CONFIG:Release>:/MT>)
|
add_compile_options($<$<CONFIG:Release>:/MT>)
|
||||||
add_compile_options($<$<CONFIG:Debug>:/MTd>)
|
add_compile_options($<$<CONFIG:Debug>:/MTd>)
|
||||||
|
else()
|
||||||
|
add_compile_options(-fPIC)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(../setup.cmake)
|
include(../setup.cmake)
|
||||||
|
|
|
@ -43,6 +43,9 @@ endif()
|
||||||
# containing the reference instead of using definitions from other modules.
|
# containing the reference instead of using definitions from other modules.
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic -Bsymbolic-functions")
|
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()
|
endif()
|
||||||
|
|
||||||
if(CLI_CMAKE_PLATFORM_ARCH_I386)
|
if(CLI_CMAKE_PLATFORM_ARCH_I386)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue