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
This commit is contained in:
moneromooo-monero 2019-06-08 18:33:04 +00:00 committed by wowario
parent ae9de01824
commit 2ae11e8e4b
No known key found for this signature in database
GPG Key ID: 24DCBE762DE9C111
1 changed files with 5 additions and 2 deletions

View File

@ -690,8 +690,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)