What changed, and why it matters
This change only adjusts compiler warning settings for the Bitcoin Core kernel build. It adds a new warning flag for newer Clang compilers to detect duplicated symbols between the kernel library and downstream users. There is no functional code change, no bug fix, and no security vulnerability being addressed.
No security action required. Treat as a normal build-system improvement. If reviewing, verify the warning flag is correctly gated by compiler version checks and does not break builds on older Clang or GCC versions.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit introduces a CMake INTERFACE library named kernel_warn_interface and appends the -Wunique-object-duplication warning (available in Clang 21+) when not using MSVC. It links this interface to bitcoinkernel and several internal dependencies (bitcoin_clientversion, bitcoin_crypto, leveldb, crc32c). The flag only warns about duplicated symbols in shared-library builds when REDUCE_EXPORTS is enabled. This is purely a build-time diagnostic addition.
Changed components
src/kernel/CMakeLists.txtInspect captured patch +16 / −0
diff --git a/src/kernel/CMakeLists.txt b/src/kernel/CMakeLists.txt
index f30ccce3..244f0098 100644
--- a/src/kernel/CMakeLists.txt
+++ b/src/kernel/CMakeLists.txt
@@ -83,9 +83,25 @@ add_library(bitcoinkernel
$<TARGET_OBJECTS:leveldb>
$<TARGET_OBJECTS:crc32c>
)
+
+# Compiler warnings that apply only to the kernel and its dependencies.
+# These can be more strict and/or warnings that only apply to shared
+# libs.
+add_library(kernel_warn_interface INTERFACE)
+if(NOT MSVC)
+ try_append_cxx_flags("-Wunique-object-duplication" TARGET kernel_warn_interface SKIP_LINK)
+endif()
+
+# Also manually apply the warnings to the kernel's internal dependencies
+target_link_libraries(bitcoin_clientversion PRIVATE kernel_warn_interface)
+target_link_libraries(bitcoin_crypto PRIVATE kernel_warn_interface)
+target_link_libraries(leveldb PRIVATE kernel_warn_interface)
+target_link_libraries(crc32c PRIVATE kernel_warn_interface)
+
target_link_libraries(bitcoinkernel
PRIVATE
core_interface
+ kernel_warn_interface
secp256k1_objs
$<$<PLATFORM_ID:Windows>:bcrypt>
$<TARGET_NAME_IF_EXISTS:USDT::headers>
Why this scored 13/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.