Skip to content
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

Rewrite rust_start in Rust #3406

Closed
brson opened this issue Sep 7, 2012 · 2 comments
Closed

Rewrite rust_start in Rust #3406

brson opened this issue Sep 7, 2012 · 2 comments
Labels
A-codegen Area: Code generation A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-cleanup Category: PRs that clean code up or issues documenting cleanup.
Milestone

Comments

@brson
Copy link
Contributor

brson commented Sep 7, 2012

Upcalls are slowly being converted to rust. We'll want to convert rust_start (the runtime entry point) as well, and I think we're almost to the point where we can do this. Some difficulties:

  • It will run on a big native stack, so the compiler will have to set up the stack limit before main
  • Any call that requires the task pointer will fail hard. In particular this means we can't do any managed allocations

We can start by just immediately calling into the existing C++ rust_start function.

@brson
Copy link
Contributor Author

brson commented Feb 19, 2013

Let's do this with a lang item #[lang = "start"].

bors added a commit that referenced this issue Feb 27, 2013
r?

#3406

Pretty straightforward. I'm using opaque pointers instead trying to get trans and core to agree on the types of the main function and crate map. One oddity is that this required changing the order of the `-lrustrt` argument to the linker in order to resolve `upcall_new_stack`. Linkers are mysterious.
@brson
Copy link
Contributor Author

brson commented Feb 27, 2013

Done.

@brson brson closed this as completed Feb 27, 2013
RalfJung pushed a commit to RalfJung/rust that referenced this issue Mar 25, 2024
many-seeds: propagate failure properly

This may help explain rust-lang/miri#3405.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-cleanup Category: PRs that clean code up or issues documenting cleanup.
Projects
None yet
Development

No branches or pull requests

1 participant