-
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
Build the standard library for an unsupported target #3
Comments
Real world example of this use case: This replaces the std using one of two options:
|
As far as porting std for a new OS, I suppose something like my Minix port is a fairly minimal example of this, since it requires changes to std (and more substantial changes to libc) but doesn't require too much since it uses the Unix backend. I started with xargo for it, but had too much many problems with that and just ended up invoking cargo directly in my Makefile to build std. Even something this simple suffers from a reasonable amount of bit rot, since the changes are spread throughout std (and particularly libc) leading to merge conflicts. Also, to keep it building, the compiler has to be pinned to a specific nightly, or it will soon fail to compile with the newer rustc for one reason or another. I'm not sure there's any easy solution to that though. |
Here's the Rust SGX SDK's issue for using std-aware Cargo: apache/incubator-teaclave-sgx-sdk#311 |
This is a "use case" issue to try to clarify and discuss a use case, and how it will be addressed.
Building a project for a target that is not available in the Rust distribution can be challenging currently. Some use tools like cargo-xbuild or xargo, or forking rust itself. One of the goals of "std-aware Cargo" is to make this process a little easier.
Many use cases for this are for
no_std
environments, and use.json
target specifications to specify the environment.Cargo already supports
.json
targets, and most of the work for supporting #2 should enable this for basic usage.However, from a higher level this use case has some other issues:
no_std
binaries often require nightly-only features. (TODO: list which are important).core
library is not always maximally portable. It might be good to explore Standard library portability to figure out what needs there are to make it more portable.std
on a new platform that does not conform to an existing one can be difficult. This might be another area to explore how to lower the difficulty.The text was updated successfully, but these errors were encountered: