Skip to content
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

Appending '-L' flags to the rustc command is not possible, preventing sysroot-like library resolution #745

Closed
codyps opened this issue Oct 22, 2014 · 3 comments
Labels
A-linkage Area: linker issues, dylib, cdylib, shared libraries, so

Comments

@codyps
Copy link
Contributor

codyps commented Oct 22, 2014

I'm running into this with yocto/openembedded:

  • oe supplies a sysroot containing a bunch of native libs and normally adjusts LDFLAGS to point gcc at it.
  • We can adjust the linker via .cargo/config to include the specified LDFLAGS, however
  • rustc also appears to do it's own library resolution prior to linking, and doesn't know about any of the extra paths passed via the linker argument, and bails out with something like:

error: could not find native static libraryz, perhaps an -L flag is missing?

@alexcrichton
Copy link
Member

Note that this is part of the motivation for rust-lang/rfcs#403. For now you can set RUST_PATH to work around this (not exactly a long-term solution though)

@alexcrichton alexcrichton added the A-linkage Area: linker issues, dylib, cdylib, shared libraries, so label Oct 24, 2014
@codyps
Copy link
Contributor Author

codyps commented Oct 24, 2014

Thanks for the pointer at RUST_PATH.

@alexcrichton
Copy link
Member

This has now been implemented via #792. Cargo does not support -L flags at the CLI level, but build scripts can now feed back into the rustc commands about where native libraries are located if they're discovered. For that reason, I'm going to close this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linker issues, dylib, cdylib, shared libraries, so
Projects
None yet
Development

No branches or pull requests

2 participants