Fix SONAME to include the ABI version suffix - #8
Open
austek wants to merge 1 commit into
Open
Conversation
The shared library's embedded SONAME was passed as
-Wl,$(SONAME)$(LIB_NAME) -- e.g. plain "libsonic.so" -- while the file
built and installed is libsonic.so.0.3.0, with libsonic.so.0 as the
versioned runtime symlink pointing at it, as reported:
$ readelf -aW /usr/lib64/libsonic.so.0 | grep -i SONAME
0x000000000000000e (SONAME) Library soname: [libsonic.so]
A correct SONAME must match that runtime symlink (libsonic.so.0), not
the unversioned dev symlink (libsonic.so) used only at link time; a
mismatched SONAME breaks the usual shared-library upgrade path, since
the dynamic linker embeds and looks up the SONAME, not the on-disk
filename.
Verified with readelf -d before/after: SONAME went from "libsonic.so"
to "libsonic.so.0" for both libsonic.so and libsonic_internal.so.
Add SONAME_SUFFIX (".0", following the LIB_TAG platform-conditional
pattern already in this file) rather than changing LIB_NAME itself,
since LIB_NAME is also used unversioned elsewhere (the dev symlink,
install rules). Empty on Darwin, where SONAME is actually an
install_name that already matches the unversioned libsonic.dylib file
this Makefile builds there (LIB_TAG is empty on Darwin too) -- so
Darwin's behavior is unchanged.
Fixes espeak-ng#1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1.
Summary
The shared library's embedded SONAME was passed as
-Wl,$(SONAME)$(LIB_NAME)— e.g. plainlibsonic.so— while the file actually built and installed islibsonic.so.0.3.0, withlibsonic.so.0as the versioned runtime symlink pointing at it, exactly as reported:```
$ readelf -aW /usr/lib64/libsonic.so.0 | grep -i SONAME
0x000000000000000e (SONAME) Library soname: [libsonic.so]
```
A correct SONAME must match that runtime symlink (
libsonic.so.0), not the unversioned dev symlink (libsonic.so) used only at link time — a mismatched SONAME breaks the usual shared-library upgrade path, since the dynamic linker embeds and looks up the SONAME, not the on-disk filename.Adds
SONAME_SUFFIX(.0, following theLIB_TAGplatform-conditional pattern already in this file) rather than changingLIB_NAMEitself, sinceLIB_NAMEis also used unversioned elsewhere (the dev symlink, install rules). Empty on Darwin, whereSONAMEis actually aninstall_namethat already matches the unversionedlibsonic.dylibfile this Makefile builds there (LIB_TAGis empty on Darwin too) — so Darwin's behavior is unchanged.Also filed and fixed upstream: waywardgeek/sonic#70 — this repo forked from there and has the identical unqualified
-Wl,$(SONAME)$(LIB_NAME)lines.Test plan
readelf -d libsonic.so.0.3.0 | grep -i soname— nowlibsonic.so.0(waslibsonic.so), matching the reporter's exact repro commandreadelf -d libsonic_internal.so.0.3.0 | grep -i soname— nowlibsonic_internal.so.0make— succeeds, symlinks (libsonic.so,libsonic.so.0→libsonic.so.0.3.0) unchanged