-
-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added SOVERSION for symlinked library generation from just a version number #3753
Conversation
soname = ShLibSonameGenerator(env, libnode) | ||
else: | ||
soname = '.'.join([libname, major, _suffix]) | ||
soname = '.'.join([libname, major, _suffix]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove using supplied SONAME?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was not the correct order of the calling functions. ShLibSonameGenerator calls into LINKCALLBACK, which calls this function if SONAME is not supplied. Since ShLibSonameGenerator calls to the more specific naming functions, it should handle SONAME and SOVERSION in ShLibSonameGenerator, and then pass the naming info down.
<example_commands> | ||
env.SharedLibrary('test', 'test.c', SHLIBVERSION='0.1.2', SOVERSION='2') | ||
</example_commands> | ||
The variable is used by linker tools which use the &t-link-link; tool such as &t-link-gnulink; or &t-link-applelink;. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expand upon the SONAME generated when SOVERSION is specified. (what would it be in the example above)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 13527e8
@@ -243,17 +235,14 @@ def _versioned_lib_symlinks(env, libnode, version, prefix, suffix, name_func, so | |||
|
|||
def _versioned_shlib_symlinks(env, libnode, version, prefix, suffix): | |||
name_func = env['LINKCALLBACKS']['VersionedShLibName'] | |||
soname_func = env['LINKCALLBACKS']['VersionedShLibSoname'] | |||
soname_func = env['ShLibSonameGenerator'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ShLibSonameGenerator ends up calling that linkcallback if SONAME is not supplied. Without this change, the ShLibSonameGenerator is skipped out.
4cc125e
to
13527e8
Compare
13527e8
to
027be11
Compare
…s into soversion_for_soname_libs
027be11
to
0fa4feb
Compare
…s into soversion_for_soname_libs
Ok tests are failing now that I removed that code I thought was left from the SONAME_GENERATOR. Maybe I took too much away, once I get a minute I'll go check it. |
…e LINKCALLBACKS generically
41ae370
to
69bbae8
Compare
…s into soversion_for_soname_libs
So if we allow setting SOVERSION (in place of setting SONAME) it should have the following impact:
In the case we have SONAME and not SOVERSION, should we extract the SOVERSION from SONAME for use in the Note we also have the following env vars
The apple bits aren't really (yet) addressed in this PR. Of note, some PR's for meson and links to cmakes implementation details
I'm guessing it's better for our user base if we match cmake/meson's implementations (rather than libtool, especially for apple). |
Closing in favor of PR #3848 which is a rewrite of existing logic and implements this logic as well. |
This PR covers just the SOVERSION updates from #3661
The SOVERSION is a new environment variable which works very similar to the SONAME environment variable, except instead of providing the full library name as you do with SONAME, you just provide an number which will generally be the major version number in the symlinked library.
The SHLIBVERSION environment variable is also very similar to this, except that the SHLIBVERSION is generally the specific version number of the library, and used on the actual output library, instead of the symlinked library.
Please review https://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html for more information on the standard conventions for library versioning in linux.
Also note that macOS uses a similar convention for versioning libraries, so this PR also adds the variable to apple linker.
Contributor Checklist:
CHANGES.txt
(and read theREADME.rst
)