-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Move link args from .cargo/config to build.rs #138
Comments
iiiinteresting. Yeah this sounds like it could be good. does it let a lib crate pass a linker script "downstream" to a binary using the lib? |
I believe so. I've converted my GBA-specific code to a local crate, and the only change I had to make from the commit I linked was to specific |
How would this work with downstream crates that have their own build requirements? I wouldn't want any of the This should be doable with a default feature flag you can turn off or something, I suppose? |
That's a good point. It would have to be feature flag controlled or something like that. Also, I think that I'll wait on this change until after cargo stabilizes it (rust-lang/cargo#9426) |
However, they decided that transitive link arguments are bad and you must always explicitly opt-in for custom link arguments (rust-lang/cargo#9554). So every binary must still copy the linker script and |
"oh good" |
Since every binary has to copy the config anyway, i think we will skip this change. |
Move the linker option from
.cargo/config.toml
tobuild.rs
using therustc-link-arg-bins
directive.Then users only needs to specific
extra-link-arg
to rustc, instead of copying the files from this repo to their project.Ref: rust-lang/cargo#7811
Ref: https://github.com/crawfxrd/gba-dev-rs/commit/db5d897aa8ec23229db6c933bb16fec221b2d199
The text was updated successfully, but these errors were encountered: