-
Notifications
You must be signed in to change notification settings - Fork 10
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
Is it necessary to modify RUSTFLAGS
in cargo-3ds
?
#14
Comments
The |
Yeah, you can test without it, but since std is linked near the end and introduces new symbol usages, those symbols need to get filled in by libctru again. The linker by default goes through its arguments linearly and throws away symbols that aren't needed at each stage. |
I just saw this too, which may help some things: rust-lang/rust#47384 (comment) Possibly unrelated to this issue, but more useful for stuff like linker fix. |
Reopened as of #40. Seems like network related functions still won't link without using |
I ran into a problem with this today, when linking I think part of the problem here is that From doing a bit of searching, perhaps we can somehow use the I am not sure of a general way to unify the linker flags (specifically Thus far I haven't found a relevant issue in https://github.com/rust-lang/wg-cargo-std-aware/ but that repo is rather large in scope so 🤷 If none of the above flags produce what we need, it's possible we could try to parse the |
I think there's something to this stemming from the fact that
cargo-3ds
adds RUSTFLAGS for linking libctru, andctru-rs
also does in its build script. I'll open an issue to investigate oncargo-3ds
Originally posted by @ian-h-chamberlain in rust3ds/ctru-rs#46 (comment)
More context: RUSTFLAGS get updated here in
cargo-3ds
, but there is already a build script forctru-sys
which specifies that it links againstlibctru
(as well as thelinks
field in Cargo.toml, although that seems to be more about convention and less functional).If rustc will automatically link to the right libraries via the build script, is it necessary to provide via RUSTFLAGS the same linker args? I have noticed when linking fails there seem to be several duplicated references to
ctru
, e.g. (edited for clarity):I think it's probably harmless to have
-lctru
multiple times like that, but I wonder if we are doing extra work unnecessarily for the linker invocation. If so, the fix would probably be to simply remove theRUSTFLAGS
modification fromcargo-3ds
.The text was updated successfully, but these errors were encountered: