-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
RUSTFLAGS Linker Flags Order #57837
Comments
Any update on this issue? |
I ran into a similar issue today trying to link some libraries that end up needing |
I have submitted an RFC about controlling
|
Closing this issue, the |
Linker flags specified by
RUSTFLAGS
are added to end of the command. Need a way to add at beginning.I have a simple rust program that compiles against multiple vendor provided shared libraries. I need to link against the shared libraries with the
--no-as-needed
flag because the dependencies of the shared libaries are not setup correctly. I do not have the source code to the libraries and I cannot recompile them.This is an example of linking a simple C++ program against the libraries. Notice the
--no-as-needed
flag is at the start of the command.I have set the
RUSTFLAGS
variable via ./.cargo/config:I then ran
cargo build -Z print-link-args
and below is the command that rust is using to link the program. Notice the--no-as-needed
is added at the end which the linker ignores.I need a way to either specify that the RUSTFLAGS should come at the beginning of the command OR a way to explictly inform rust to link to
--no-as-needed
Meta
rustc --version --verbose
:rustc 1.33.0-nightly (e2f221c 2019-01-15)
binary: rustc
commit-hash: e2f221c
commit-date: 2019-01-15
host: x86_64-unknown-linux-gnu
release: 1.33.0-nightly
LLVM version: 8.0
OS: Ubuntu 18.04
The text was updated successfully, but these errors were encountered: