From b4727e18785441108dbe91e815bde85f300bb31a Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Sat, 28 Sep 2024 16:15:33 +0200 Subject: [PATCH] Enable the -fno-assume-unique-vtables flag is possible on clang, in order to work around likely buggy compiler optimisation. --- cmake/yacma/YACMACompilerLinkerSettings.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cmake/yacma/YACMACompilerLinkerSettings.cmake b/cmake/yacma/YACMACompilerLinkerSettings.cmake index 3d9cd9dab..e56321846 100644 --- a/cmake/yacma/YACMACompilerLinkerSettings.cmake +++ b/cmake/yacma/YACMACompilerLinkerSettings.cmake @@ -125,6 +125,18 @@ if(NOT _YACMACompilerLinkerSettingsRun) _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Warray-bounds-pointer-arithmetic) # New warnings in clang 14. _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Warray-parameter) + # NOTE: clang 17 enables by default a new compiler flag called "-fassume-unique-vtables": + # + # https://releases.llvm.org/17.0.1/tools/clang/docs/ReleaseNotes.html#c-language-changes + # + # This flag however seems to be buggy: + # + # https://github.com/llvm/llvm-project/issues/71196 + # + # On our part, in several projects we are experiencing Boost.serialization failures when + # (de)serialising derived objects through pointers to bases. Thus, we forcibly disable + # this new flag. + _YACMA_CHECK_ENABLE_CXX_FLAG(-fno-assume-unique-vtables) endif() # Common configuration for GCC, clang and Intel.