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 | f47651578f55756823b8da3ebf9b28f752a5bc67 (diff) | |
| parent | c66e8d92e4a4a5029d8014e4fb1c96f26ab9d0ff (diff) | |
| download | monzero-core-466e245f26563dfb733f522992b36e273c2242be.tar.gz monzero-core-466e245f26563dfb733f522992b36e273c2242be.tar.xz monzero-core-466e245f26563dfb733f522992b36e273c2242be.zip | |
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) |
