-
Notifications
You must be signed in to change notification settings - Fork 148
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
Build fails on macOS 10.14.6 Mojave #176
Comments
This also happens on macOS 10.12 Sierra |
This may be the same root cause as #174 |
Assuming that this is resolved. |
Oops, sorry, missed previous notification. Yes, indeed it works now! Thanks a lot! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Simplest program depending on
libssh2-sys = "0.2.16"
and doinglibssh2_sys::init();
fails on macOS 10.14.6 Mojave.Here is the project: https://github.com/idubrov/openssl-macos-issue
For convenience, this is all it is:
Cargo.toml
src/main.rs:
Steps to reproduce: run
cargo run
on macOSResults:
Investigating the cause revealed that wrong openssl library is being linked.
Note that it passes
"-L" "/usr/local/opt/openssl@1.1/lib"
, which is the version I want to link to. However, in front of it, there is"-L" "/usr/lib"
, which makes linker to look in system directory and link to the version of OpenSSL shipped with macOS (which is 0.9).Running
cargo -vv run
reveals the following piece of configuration emitted bylibssh2-sys
build:Which, I think, is the cause for the error above.
To confirm, I added
-Xlinker -v
argument to the"cc"
command above and got the following listing:Note how
/usr/lib
is included twice -- once before/usr/local/opt/openssl@1.1/lib
and once after. I think, the latter is added by default. However, the former one, I think, is caused bylibssh2-sys
build.To summarize:
libssh2-sys
build adds/usr/lib
as a search path for libraries.openssl-sys
build adds/usr/local/opt/openssl@1.1/lib
as a search path for libraries. It, however, goes after/usr/lib
.openssl-sys
uses includes from/usr/local/opt/openssl@1.1/include
(correct), but when final binary is linked, it is linked against openssl in/usr/lib
(incorrect).I think this is an issue with
libssh2-sys
build (but could be caused by downstream libraries like,pkg_config
).(also, reported to
openssl
crate for visibility sfackler/rust-openssl#1252)The text was updated successfully, but these errors were encountered: