Merge pull request #2908

210248e cmake: disable '-pie' on Win with gcc (xiphon)
pull/7/head
luigi1111 4 years ago
commit c20a0ef928
No known key found for this signature in database
GPG Key ID: F4ACA0183641E010

@ -369,8 +369,8 @@ if (NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VER
endif()
# linker
if (NOT (WIN32 AND (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1)))
# Windows binaries die on startup with PIE when compiled with GCC <9.x
if (NOT (WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "GNU"))
# Windows binaries die on startup with PIE when compiled with GCC
add_linker_flag_if_supported(-pie LD_SECURITY_FLAGS)
endif()
add_linker_flag_if_supported(-Wl,-z,relro LD_SECURITY_FLAGS)