-
Notifications
You must be signed in to change notification settings - Fork 655
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
Skipping linker flag for versioned dylib on Darwin #2989
Conversation
Wouldn't it make more sense to strip the version from the versioned one from the linking command line? instead of manually adding it in the clinkopts and removing duplicates ? |
On Linux, @jayconrod commented:
On Darwin, stripping the version and passing something like |
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.
Can you test if it works when the file name is in the standard darwin versioned dylib format (libname.$VERSION.dylib
)? (Maybe there should be a test for this too?)
Also, I think the PR description should be more clear that this is to support the non-standard naming scheme which we found in the Oracle client.
What type of PR is this?
Bug fix
What does this PR do? Why is it needed?
The linker cannot find the versioned dylib on macOS with
-l :libclntsh.dylib.12.1
like we did for Linux. According to Mac OS X For Unix Geeks, 4th Edition, Chapter 11, a versioned libMagick library should be named in the form oflibMagick.10.0.7.dylib
, and linked with-lMagick.10.0.7
. The logic for passing such linker flag is the same as an unversioned shared library.However, when distributing Instant Client for macOS, Oracle decided to put the version number at the end of the file name using the same convention as shared libraries on Linux. Fortunately, recent versions of Instant Client also come with an unversioned symbolic link pointing to the versioned dylib. We can use the symlink as an unversioned shared library.
In both cases, we don't need any specific logic to pass linker flags for versioned dylib for Darwin.
Which issues(s) does this PR fix?
Fixes #2944
Other notes for review
Alternatively, we can try to figure out how to pass linker options so it can find the versioned dylib files on macOS without the symlink