]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Use C++20 standard consistently to resolve ODR violations 5592/head
authorPetr Vaněk <arkamar@atlas.cz>
Fri, 29 Aug 2025 08:31:24 +0000 (10:31 +0200)
committerPetr Vaněk <arkamar@atlas.cz>
Fri, 29 Aug 2025 09:09:59 +0000 (11:09 +0200)
This commit resolves an ODR violations when compiling with -flto and
-Werror=odr [1]. The main project used a newer C++20 standard, while the
backward-cpp and simdutf libraries used an older C++11 standard. This
difference caused the linker to fail.

Setting C++20 standard in both libraries resolves the ODR issue.

Link: https://bugs.gentoo.org/962041
contrib/backward-cpp/CMakeLists.txt
contrib/simdutf/cmake/simdutf-flags.cmake

index 9aa7bb13dccf463270324d7a5ccee37bc3fd5dfb..317e5f42e1c66a0f8211683628db90dc3ae5bd5b 100644 (file)
@@ -46,7 +46,7 @@ endif()
 
 # set CXX standard
 set(CMAKE_CXX_STANDARD_REQUIRED True)
-set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD 20)
 if (${COMPILER_IS_NVCC})
   # GNU CXX extensions are not supported by nvcc
   set(CMAKE_CXX_EXTENSIONS OFF)
index accc33273830fde275d9c806048d60244b454538..642c08412d660032db75e7e439acb6a6a9308738 100644 (file)
@@ -18,7 +18,7 @@ endif()
 set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake")
 
 # We compile tools, tests, etc. with C++ 11. Override yourself if you need on a target.
-set(SIMDUTF_CXX_STANDARD 11 CACHE STRING "the C++ standard to use for simdutf")
+set(SIMDUTF_CXX_STANDARD 20 CACHE STRING "the C++ standard to use for simdutf")
 
 set(CMAKE_CXX_STANDARD ${SIMDUTF_CXX_STANDARD})
 set(CMAKE_CXX_STANDARD_REQUIRED ON)