-
Notifications
You must be signed in to change notification settings - Fork 8
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
How to handle special object files? #46
Comments
I've been following along here for GBA support. In that case, there is a crt0 style file, and you can build it directly from source. You could even say that it's preferred to build the crt0 from source. |
|
One aspect of Cargo that will make this quite difficult is that Cargo, up to this point at least, is target-agnostic in as many ways as it can be, almost never hardcoding logic about particular targets. I think we've done this for things like multiple outputs with pdbs/emscripten js/etc, but otherwise there's very little target-specific logic in Cargo. These object files are inherently target-specific, though, encoded into custom target specifications: Most of these aren't actually built from Rust code, To summarize my previous conclusion, I don't see a great way to handle this really other than letting rustc know that it's being built externally by Cargo, so rustc can't assume these objects exist and must rely on some form of an external toolchain providing them. Targets like musl/wasi are already weird in that they won't build by default because they try to find a static version of |
I believe rust-lang/rust#68887 (comment) will help here. TL;DR IMO building std should be the same as non self-contained mode so the only this it has to care about is building |
Some targets ship pre-built object files needed to link on the target (such as "crt" files). How should these be handled?
There is some more detail in #30 (comment).
Some examples:
crt1.o
,crti.o
,crtn.o
dllcrt2.o
crt2.o
rsbegin.o
rsend.o
I don't know offhand how these magic object files are created in the first place. Is it feasible to build them from source? Are there any alternatives? If not, then maybe the only option is to require the user to install these pre-built targets, and Cargo can copy these
.o
files into the sysroot?The text was updated successfully, but these errors were encountered: