You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Move link args from .cargo/config to build.rs #138
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 CARGO_MANIFEST_DIR for the full linker file path (build.rs).
How would this work with downstream crates that have their own build requirements? I wouldn't want any of the gba crate's default linker settings, as I'm writing a patch that gets integrated into an existing ROM as part of a ROM hack -- something that obviously requires a very different linker script compared to normal.
This should be doable with a default feature flag you can turn off or something, I suppose?
Activity
Lokathor commentedon Apr 30, 2021
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?
crawfxrd commentedon Apr 30, 2021
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
CARGO_MANIFEST_DIRfor the full linker file path (build.rs).Lymia commentedon May 2, 2021
How would this work with downstream crates that have their own build requirements? I wouldn't want any of the
gbacrate's default linker settings, as I'm writing a patch that gets integrated into an existing ROM as part of a ROM hack -- something that obviously requires a very different linker script compared to normal.This should be doable with a default feature flag you can turn off or something, I suppose?
Lokathor commentedon May 2, 2021
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)
crawfxrd commentedon Jul 27, 2021
rustc-link-argwas stabilized (rust-lang/cargo#9557).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
build.rs/.cargo/config.Lokathor commentedon Jul 28, 2021
"oh good"
Lokathor commentedon Oct 6, 2022
Since every binary has to copy the config anyway, i think we will skip this change.