aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-06-08 18:33:04 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-06-09 09:40:55 +0000
commitce13a98239c3d199bd9dde021266191540f34163 (patch)
tree035a8bc526dbeaa662ec0a07aa3fc82a6ce9ef11
parentFix GCC 9.1 build warnings (diff)
downloadmonero-ce13a98239c3d199bd9dde021266191540f34163.tar.xz
cmake: do not use -mmitigate-rop on GCC >= 9.1
It was removed, but it still accepted by the compiler, which warns for every file
-rw-r--r--CMakeLists.txt7
1 files changed, 5 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 037b9cb50..6a22478e9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -672,8 +672,11 @@ else()
add_cxx_flag_if_supported(-fstack-clash-protection CXX_SECURITY_FLAGS)
endif()
- add_c_flag_if_supported(-mmitigate-rop C_SECURITY_FLAGS)
- add_cxx_flag_if_supported(-mmitigate-rop CXX_SECURITY_FLAGS)
+ # Removed in GCC 9.1 (or before ?), but still accepted, so spams the output
+ if (NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1))
+ add_c_flag_if_supported(-mmitigate-rop C_SECURITY_FLAGS)
+ add_cxx_flag_if_supported(-mmitigate-rop CXX_SECURITY_FLAGS)
+ endif()
# linker
if (NOT WIN32)