Skip to content

Commit

Permalink
cmake: do not use -mmitigate-rop on GCC >= 9.1 /monero#5613
Browse files Browse the repository at this point in the history
It was removed, but it still accepted by the compiler, which warns
for every file
  • Loading branch information
moneromooo-monero authored and polarisfm committed Dec 30, 2020
1 parent e3be82a commit 380096a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Expand Up @@ -684,8 +684,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)
Expand Down

0 comments on commit 380096a

Please sign in to comment.