aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlo Cabrera <30379873+carlocab@users.noreply.github.com>2022-02-06 14:58:40 +0800
committerCarlo Cabrera <30379873+carlocab@users.noreply.github.com>2022-02-06 15:24:06 +0800
commit52976011e57a8ec6037a8f39b5b989f5f31b00dc (patch)
tree4163ee44f80f935041562ff6e31312549e0c0f76
parentFix blksize adjustment when exceeding alloca limit in libkeccak_generalised_sum_fd (diff)
downloadlibkeccak-52976011e57a8ec6037a8f39b5b989f5f31b00dc.tar.gz
libkeccak-52976011e57a8ec6037a8f39b5b989f5f31b00dc.tar.bz2
libkeccak-52976011e57a8ec6037a8f39b5b989f5f31b00dc.tar.xz
Implement library versioning for macOS
Currently, the Makefile provides no version information about library to the macOS linker. This makes the linker fill in zeroes for `compatibility_version` and `current_version` by default. This is a problem for when you make breaking changes to the library that require re-compilation of linked software. The new library will still have a `compatibility_version` of `0.0.0`, which misleads the linker into believing the new library is a drop-in replacement for the old one. Let's fix that by making sure we pass version information correctly to the linker on macOS. NOTE: Since this increments the `compatibility_version` of the DSO from `0.0.0` to `1.0.0`, this change will require re-compilation of any macOS software that dynamically link against `libkeccak`. If you'd like to avoid this inconvenience for your users, you may wish to wait until you decide to increment `LIB_MAJOR` or otherwise make breaking changes to `libkeccak` before merging this change.
Diffstat (limited to '')
-rw-r--r--macos.mk2
1 files changed, 1 insertions, 1 deletions
diff --git a/macos.mk b/macos.mk
index b475197..c7e7c28 100644
--- a/macos.mk
+++ b/macos.mk
@@ -1,5 +1,5 @@
LIBEXT = dylib
-LIBFLAGS = -dynamiclib
+LIBFLAGS = -dynamiclib -Wl,-compatibility_version,$(LIB_MAJOR) -Wl,-current_version,$(LIB_VERSION)
LIBMAJOREXT = $(LIB_MAJOR).$(LIBEXT)
LIBMINOREXT = $(LIB_VERSION).$(LIBEXT)