From 79d5ce5488dc0fd95ca688bf80134bbc7e4478fc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Jun 2026 14:26:12 +0000 Subject: [PATCH 1/2] Initial plan From 3d34e304e168050fadc08852893aff280c9e8c82 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Jun 2026 14:54:22 +0000 Subject: [PATCH 2/2] Fix odr_check visibility: add BOOST_SYMBOL_VISIBLE to prevent false ODR violation with dynamic loading When a project uses hidden (which adds -fvisibility-inlines-hidden), template static variable initializers like odr_check::inc get hidden symbol visibility. When multiple shared libraries are loaded via RTLD_GLOBAL on ELF systems (e.g. s390x), hidden symbols are not deduplicated by the dynamic linker. Each DSO initializes its own copy of inc, each time incrementing the shared count variable. When count > 1, initialize() falsely fires the ODR violation check. Fix: add BOOST_SYMBOL_VISIBLE to odr_check struct, which expands to __attribute__((__visibility__("default"))) on GCC/Clang (no-op on MSVC/Windows). This overrides -fvisibility-inlines-hidden for all struct members including the inc template static, ensuring proper RTLD_GLOBAL symbol deduplication. Also add the required #include for BOOST_SYMBOL_VISIBLE. --- include/boost/openmethod/preamble.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/openmethod/preamble.hpp b/include/boost/openmethod/preamble.hpp index 39b82c6f..789dda81 100644 --- a/include/boost/openmethod/preamble.hpp +++ b/include/boost/openmethod/preamble.hpp @@ -3,6 +3,7 @@ #include +#include #include #include @@ -96,7 +97,7 @@ struct odr_violation : openmethod_error { namespace detail { template -struct odr_check { +struct BOOST_SYMBOL_VISIBLE odr_check { static std::size_t count; template static std::size_t inc;