aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2021-02-16 11:40:40 -0500
committerluigi1111 <luigi1111w@gmail.com>2021-02-16 11:40:40 -0500
commit466e245f26563dfb733f522992b36e273c2242be (patch)
tree5f737ce71872971a711683a9935bcdba8a7545db
parentMerge pull request #7311 from selsta/miniupnp (diff)
parentbuild: omit '-pie' linker flag in native non static WIN32 GCC builds (diff)
downloadmonero-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.txt3
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)