3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-10-08 17:01:55 +00:00

Fix dylib versioning in pip packages for macOS

Adds proper -compatibility_version and -current_version linker flags
for macOS builds using the mk_util.py build system.

This resolves issue #6651 where .dylib files in pip packages had
incorrect version info (0.0.0) compared to homebrew builds which
had proper versioning.

The fix adds the appropriate linker flags to SLIBEXTRAFLAGS when
building on macOS:
- compatibility_version: major.minor.0 (minimum compatible version)
- current_version: major.minor.build (current library version)

This ensures pip package dylibs will have correct version metadata
that matches the actual Z3 version, fixing linking issues for
users who depend on proper dylib versioning.

Fixes #6651
This commit is contained in:
Daily Backlog Burner 2025-09-17 01:40:10 +00:00
parent 81da4be228
commit c41d11409a

View file

@ -2697,6 +2697,13 @@ def mk_config():
CXXFLAGS = '%s -arch arm64' % CXXFLAGS CXXFLAGS = '%s -arch arm64' % CXXFLAGS
LDFLAGS = '%s -arch arm64' % LDFLAGS LDFLAGS = '%s -arch arm64' % LDFLAGS
SLIBEXTRAFLAGS = '%s -arch arm64' % SLIBEXTRAFLAGS SLIBEXTRAFLAGS = '%s -arch arm64' % SLIBEXTRAFLAGS
if IS_OSX:
# Add proper dylib versioning flags for macOS
# compatibility_version is the minimum version that can use this library
# current_version is the current version of this library
compatibility_version = "{}.{}.0".format(VER_MAJOR, VER_MINOR)
current_version = "{}.{}.{}".format(VER_MAJOR, VER_MINOR, VER_BUILD)
SLIBEXTRAFLAGS = '%s -Wl,-compatibility_version,%s -Wl,-current_version,%s' % (SLIBEXTRAFLAGS, compatibility_version, current_version)
if IS_OSX and is_ml_enabled(): if IS_OSX and is_ml_enabled():
SLIBFLAGS += ' -Wl,-headerpad_max_install_names' SLIBFLAGS += ' -Wl,-headerpad_max_install_names'