From c2ea9dc562dceaf58936b16edb8ed929d55d56f3 Mon Sep 17 00:00:00 2001 From: Bill Meek Date: Sat, 21 Sep 2024 17:49:23 -0500 Subject: [PATCH] cmake: test availability of -fcf-protection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Builds on an Orange Pi running Ubuntu 22.04 fail if -fcf-protection is used. Compilers are 11.4.0. Architecture is aarch64. c++, g++ and gcc return: cc1plus: error: ‘-fcf-protection=full’ is not supported for this target --- mythtv/external/libexiv2/cmake/compilerFlags.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mythtv/external/libexiv2/cmake/compilerFlags.cmake b/mythtv/external/libexiv2/cmake/compilerFlags.cmake index 20a424cd060..9c0e090a2c6 100644 --- a/mythtv/external/libexiv2/cmake/compilerFlags.cmake +++ b/mythtv/external/libexiv2/cmake/compilerFlags.cmake @@ -26,7 +26,11 @@ if ( MINGW OR UNIX OR MSYS ) # MINGW, Linux, APPLE, CYGWIN # This fails under Fedora - MinGW - Gcc 8.3 if (NOT MINGW) if (COMPILER_IS_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0) - add_compile_options(-fstack-clash-protection -fcf-protection) + add_compile_options(-fstack-clash-protection) + check_cxx_compiler_flag(-fcf-protection HAS_FCF_PROTECTION) + if (${HAS_FCF_PROTECTION}) + add_compile_options(-fcf-protection) + endif() endif() if (COMPILER_IS_GCC OR (COMPILER_IS_CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 3.7 ))