-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Freestanding (runtime-less) Rust #3608
Comments
#3406 is related. |
I don't think we strictly need any attributes to disable stack growth, since we can just flip some bits at runtime to make stack growth not happen, but omitting the stack growth function prologue would be a potentially significant optimization. What this most depends on is changing the way extern fns are declared and implemented so that we can separate the generation of Rust-ABI wrapper functions from the generation of C-ABI functions. Beyond that we need to make sure that the failure modes are consistent ( Additional related stuff:
|
I think it might be useful to have @ boxes degrade to refcounting (without cycle detection) in runtime-less mode, since they're a language feature. I think it would make it much easier to write code portable between runtime and runtime-less Rust if one can rely on all language features being there. Tasks on the other hand are presented as a library, so their absence in something explicitly called runtime-less would be a lot less surprising. I don't know if it would be possible to have tasks degrade to posix threads, since their semantics are different and it may just be confusing. |
|
nominating for backwards-compatible milestone |
accepted for backwards-compatible milestone |
I think this is basically done with |
It is not clear how to build freestanding binaries, with
This very issue also has no instructions on using At the very least I feel that |
@Babazka, since #[no_std];
#[start]
fn main(_: int, _: **u8, _: *u8) -> int { 0 } It doesn't do a whole lot obviously, but it compiles and doesn't link to
At this point though, rust is pretty close to being able to run with "no runtime", so it may be a proper time to start opening sub-issues instead of lumping everything into one issue. Until that point though, I'm going to reopen because I agree that this isn't 100% done yet. |
An option to allow one to specify an alternate runtime (rather than whether or not to include or not to include the runtime) would be handy. |
Turning this into a metabug. Have filed bugs for the first two of @alexcrichton's points, but I'm not sure what to do about the third. |
See also #7282 |
Perhaps this interpretation of freestanding is slightly different, but I must use the following way to compile an OS:
Normally, code generated by rustc is position-independent. |
This is a great idea if rust is to be seen as a C alternative. (eg C is sometimes used in niches where you dont even have malloc/free) |
Lots of progress has been made here, and I don't think the past discussions are very relevant now. Rust has strong support for this as a language, but the standard library is unavailable. The needs of the real-time/embedded/kernel niches will result in concepts like allocators in the standard library, and I would like to figure this all out in a separate repository before submitting any half-baked attempts. I've opened #10043 about integrating rust-core upstream, and I'll open any language level issues on rust's issue tracker as they are discovered. |
bitrig support has been removed (by me) in rust-lang#60775
Right now, if you want to do any of the following:
you are thwarted by the inability of Rust code to escape the Rust runtime. This ticket is intended to centralize discussion of how this could be done.
Some old random comments:
The text was updated successfully, but these errors were encountered: