cmake: Fix shared library versioning on NetBSD
What changed, and why it matters
This commit fixes how version numbers are assigned to the shared library when building on NetBSD. It is a build-system portability fix with no apparent security relevance.
No security action required; treat as a normal build-system portability fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change adds a NetBSD branch in cmake/SetLibtoolAbiVersion.cmake to set SOVERSION and VERSION according to NetBSD’s shared-library versioning conventions (similar to SunOS: major=current, full version=current.revision). This aligns the CMake build with libtool behavior and prevents incorrect library versioning on NetBSD. No cryptographic, memory-safety, or input-handling code is modified.
Changed components
cmake/SetLibtoolAbiVersion.cmakeInspect captured patch +8 / −0
diff --git a/cmake/SetLibtoolAbiVersion.cmake b/cmake/SetLibtoolAbiVersion.cmake
index 8665daa..10ef8e1 100644
--- a/cmake/SetLibtoolAbiVersion.cmake
+++ b/cmake/SetLibtoolAbiVersion.cmake
@@ -18,6 +18,14 @@ function(set_libtool_abi_version target current revision age)
SOVERSION ${_major}
VERSION ${_major}.${age}.${revision}
)
+ elseif(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
+ # version_type = sunos
+ # major = $current
+ # versuffix = $current.$revision
+ set_target_properties(${target} PROPERTIES
+ SOVERSION ${current}
+ VERSION ${current}.${revision}
+ )
elseif(APPLE)
# version_type = darwin
# major = $current - $age
Why this scored 16/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.