diff options
author | luigi1111 <luigi1111w@gmail.com> | 2021-02-16 11:40:40 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2021-02-16 11:40:40 -0500 |
commit | 466e245f26563dfb733f522992b36e273c2242be (patch) | |
tree | 5f737ce71872971a711683a9935bcdba8a7545db | |
parent | Merge pull request #7311 from selsta/miniupnp (diff) | |
parent | build: omit '-pie' linker flag in native non static WIN32 GCC builds (diff) | |
download | monero-466e245f26563dfb733f522992b36e273c2242be.tar.xz |
Merge pull request #7313
c66e8d9 build: omit '-pie' linker flag in native non static WIN32 GCC builds (xiphon)
-rw-r--r-- | CMakeLists.txt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c6d102ba7..d67ed7b9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -714,9 +714,10 @@ else() endif() # linker - if (NOT SANITIZE AND NOT OSSFUZZ AND NOT (WIN32 AND (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1))) + if (NOT SANITIZE AND NOT OSSFUZZ AND NOT (WIN32 AND (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND (CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1 OR NOT STATIC)))) # PIE executables randomly crash at startup with ASAN # Windows binaries die on startup with PIE when compiled with GCC <9.x + # Windows dynamically-linked binaries die on startup with PIE regardless of GCC version add_linker_flag_if_supported(-pie LD_SECURITY_FLAGS) endif() add_linker_flag_if_supported(-Wl,-z,relro LD_SECURITY_FLAGS) |