-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[openssl] Handle INSTALL_NAME_DIR and OSX_DEPLOYMENT_TARGET for macOS shared builds #14785
Conversation
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.
Thanks for the PR!
Could you update the Port-Version to 2 in CONTROL file?
eb029ca
to
0ee0ebc
Compare
I knew I forgot something. Fixed and Thanks |
@LRFLEW, here is gdal failures with x64-linux and x64-osx from CI testing:
|
@PhoebeHui I saw that error, but I can't figure out what to make of it. It's an error in an unrelated port in a file that should have no relation to any of the changes made here. Since this error appeared in the CI for an unrelated PR as well (#14799), I suspect this might be a problem from the master branch. I can try rebasing the PR against any changes made to master in case there's a fix there. |
@LRFLEW, gdal depends on libpq, and libpq depends on openssl, so it might relate to this changes, I verified gdal:x64-linux on master, it installed successfully.
|
@PhoebeHui I setup a Docker instance and tried building gdal on master, and I was able to confirm that it did succeed for me (once I worked around Docker killing the linker tasks). I then tried building my branch and could not reproduce the issue that the CI is seeing. I don't know what's different about my setup to the CI's exactly, but it's hard for me to debug it when I can't see the issue for myself. Looking into the error message itself, it still seems to me like it's unrelated to this PR. The type error is happening when constructing an object of type |
0ee0ebc
to
620bbd9
Compare
Well, rebasing against master did seem to "fix" the error. This could just have been a matter of re-running the test. Perhaps the Jasper thing I mentioned should be looked into, but that would be a separate issue from this one. |
@LRFLEW, thanks for looking into this issue! It might due to Jasper, I will confirm this issue locally, anyway, it should be another issue, should not block this PR. |
Confirmed this issue on master, and found when jasper installed before gdal, gdal will fail on linux and osx. I will look into the failures. It is not relate to this changes. please ignore it.
|
@strega-nil, could you help further review? |
LGTM! Thanks @LRFLEW |
Extending microsoft#39313 to fix issues such as microsoft#14785 with openssl where libssl wasn't pointing to the rpath fixed id of libcrypto.
#8) Extending microsoft#39313 to fix issues such as microsoft#14785 with openssl where libssl wasn't pointing to the rpath fixed id of libcrypto. Co-authored-by: Derek Cyrus-Chow <derek.chow@catapult.com>
A few years ago, I made a PR here involving the dylib-id's of shared library builds for macOS and iOS (#4477). This updates the OpenSSL port to properly handle this functionality.
dylib-id's are weird, but put simply, they are strings stored inside of dylib files that are used when linking projects to it to say where the executable should look for the library at runtime. The default behavior generally is to set the dylib-id to the installation absolute path, as that's how it works for system-installed libraries. The default behavior for CMake and vcpkg (since my old PR), however, is to have the dylib-id be
@rpath/<library>.dylib
, which is generally what's used for user distributions (namely .app bundles). The old PR also included a way of specifying the dylib-id directory via a custom triplet.Since the OpenSSL port (for "Unix") just wraps the automake system, this setting is not properly handled, and the dylib-id ends up being set to the absolute installation path. This PR uses
install_name_tool
to update the dylib-id's based on the CMake settings. (The other way of setting the dylib-id is to use the-install_name
argument in the linker command, but doing this would require patching the autoconf setup, as the OpenSSL project doesn't include a way of changing the argument value.)So I realized that another change I made in that old PR, the one for the minimum macOS target, also wasn't being handled by the OpenSSL port. The solution for this one was simpler, as it's the same as for
OSX_SYSROOT
. I decided to combine the changes into the same PR, as I see little reason to have them reviewed separately.