diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2020-05-15 17:18:50 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2020-05-15 17:18:50 +0000 |
commit | cb4edc1f45f5b2290a79c86a6171c68581e79855 (patch) | |
tree | 3ef05e6558742d75c2419fa61726364dfbc8a170 /CMakeLists.txt | |
parent | fuzz_tests: refactor and add OSS-Fuzz compatibility (diff) | |
download | monero-cb4edc1f45f5b2290a79c86a6171c68581e79855.tar.xz |
cmake: ASAN and PIE don't mix
Binaries built with both crash on startup with maybe 25% probability
Diffstat (limited to '')
-rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 14af3b452..4fcf782aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -652,7 +652,8 @@ else() endif() # linker - if (NOT (WIN32 AND (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1))) + if (NOT SANITIZE AND NOT (WIN32 AND (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1))) + # PIE executables randomly crash at startup with ASAN # Windows binaries die on startup with PIE when compiled with GCC <9.x add_linker_flag_if_supported(-pie LD_SECURITY_FLAGS) endif() @@ -774,7 +775,8 @@ else() endif(ARM) - if(ANDROID AND NOT BUILD_GUI_DEPS STREQUAL "ON" OR IOS) + # random crash on startup when asan is on if pie is enabled + if(NOT SANITIZE AND ANDROID AND NOT BUILD_GUI_DEPS STREQUAL "ON" OR IOS) #From Android 5: "only position independent executables (PIE) are supported" message(STATUS "Enabling PIE executable") set(PIC_FLAG "") |