-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustc --target argument hard-coded in generated libraries #24666
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
Comments
Should a hash of the (parsed and normalized) target spec be used, instead? |
That would solve the problem I think. Maybe instead of hashing include the whole (normalized) target spec so the compiler can give a better hint on a conflict? |
A problem is that strings inside the target file may be equivalent. For example: "features": "-3dnow,-3dnowa" vs. "features": "-3dnowa,-3dnow" |
Ideally, the actual contents of the json file would be included, but storing a hash would at least allow the same target file to be used from different working directories. |
So, running into this again. Given that the existing solution (compare exact paths given to |
You can get around this by using the RUST_TARGET_PATH environment variable and only using the basename. Note that this also affects cross-installation and finding of libstd: if you build libstd with an absolute path, there is no way to install it such that rustc can find std for your target. |
Few more things from the issue I closed as a duplicate of this one:
|
Triage: don't believe anything has changed here |
Fixed by #98225 by storing the contents of the target spec instead. |
Using --target feature in rust will hard-code the provided path in the library. Linking these libraries against applications will fail if they use same target.json but with a different (e.g., relative) path.
I tried this code:
lib.rs:
main.rs
Now, I compile the lib.rs as a library
...and main.rs as an application using liblib.rlib (I'm in folder play):
Instead, this happened:
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: