Linking problems with 1.12-beta1


Not sure if this is an issue with Cargo or the compiler, but I’ve started seeing linking errors with libssh2-sys when using 1.12.0-beta1:

[mangole] > cargo build
    Updating registry ``
 Downloading ssh2 v0.2.13
 Downloading bitflags v0.1.1
 Downloading libc v0.2.15
 Downloading libssh2-sys v0.1.39
 Downloading libz-sys v1.0.5
 Downloading gcc v0.3.35
 Downloading pkg-config v0.3.8
 Downloading cmake v0.1.17
 Downloading openssl-sys v0.7.17
   Compiling gcc v0.3.35
   Compiling pkg-config v0.3.8
   Compiling libssh2-sys v0.1.39
   Compiling libc v0.2.15
   Compiling bitflags v0.1.1
   Compiling openssl-sys v0.7.17
   Compiling libz-sys v1.0.5
error[E0465]: multiple dylib candidates for `std` found
note: candidate #1: /usr/local/lib/rustlib/x86_64-apple-darwin/lib/libstd-    411f48d3.dylib
note: candidate #2: /usr/local/lib/libstd-411f48d3.dylib

error[E0463]: can't find crate for `std`

error: aborting due to 2 previous errors

error: Could not compile `libssh2-sys`.

To learn more, run the command again with --verbose.
[mangole] >

If I switch back to 1.11.0 and rebuild, the same project links clearly. This is on OS X 10.11.6. Is anyone else seeing this problem?



Following up to myself, for the record…

This project links against libssh2, which is installed in /usr/local/, as is the Rust compiler. With Rust 1.11, I needed to add

-rustc-link-search = ["/usr/local/lib"]

in my Cargo config, to make it find libssh2. With Rust 1.12-beta1, this is no longer needed, and if present, causes error E0465.


Filed a bug:

@csperkins if you can share the repo that causes this or provide a reduced test case that would be great.