[client/host] disable stack execution

This commit is contained in:
Geoffrey McRae 2021-01-05 00:01:45 +11:00
parent 523accf348
commit 0bd5f0b2f1
2 changed files with 8 additions and 2 deletions

View File

@ -37,7 +37,7 @@ add_compile_options(
"$<$<CONFIG:DEBUG>:-O0;-g3;-ggdb>" "$<$<CONFIG:DEBUG>:-O0;-g3;-ggdb>"
) )
set(EXE_FLAGS "-Wl,--gc-sections") set(EXE_FLAGS "-Wl,--gc-sections -z noexecstack")
set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD 11)
find_package(PkgConfig) find_package(PkgConfig)

View File

@ -66,7 +66,13 @@ target_link_libraries(looking-glass-host
platform platform
lgmp lgmp
) )
set_target_properties(looking-glass-host PROPERTIES LINK_FLAGS "-Wl,--gc-sections")
if(WIN32)
set_target_properties(looking-glass-host PROPERTIES LINK_FLAGS "-Wl,--gc-sections -Wl,--nxcompat")
else()
set_target_properties(looking-glass-host PROPERTIES LINK_FLAGS "-Wl,--gc-sections -z noexecstack")
endif()
install(PROGRAMS ${CMAKE_BINARY_DIR}/looking-glass-host DESTINATION bin/ COMPONENT binary) install(PROGRAMS ${CMAKE_BINARY_DIR}/looking-glass-host DESTINATION bin/ COMPONENT binary)
feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES) feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES)