From 315d5ae498c1260a1c7d1e77ab8fc7da17230916 Mon Sep 17 00:00:00 2001 From: Steffen Olszewski Date: Tue, 21 Nov 2023 19:57:37 +0100 Subject: [PATCH] Fix compilation on GCC 4.6 The compiler flag `-fcf-protection` is only available since GCC 8.1. Closes #892 --- cmake/compiler-flags.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/compiler-flags.cmake b/cmake/compiler-flags.cmake index 19206b63..ee399b15 100644 --- a/cmake/compiler-flags.cmake +++ b/cmake/compiler-flags.cmake @@ -256,7 +256,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU) # -fcf-protection is supported only on x86 GNU/Linux per this gcc doc: # https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#index-fcf-protection if ((CMAKE_SYSTEM_NAME STREQUAL "Linux") AND (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)")) - add_compiler_flags(4.6 "-fcf-protection") + add_compiler_flags(8.1 "-fcf-protection") endif () add_compiler_flags(4.6 "-pipe") add_compiler_flags(4.6 "-Werror=format-security")