-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Stack overflow in rustc when trying to make bare metal executable #20918
Labels
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
Comments
Backtrace with lldb shows:
|
This no longer overflows the stack - it triggers an LLVM assertion instead. I've reduced the repro case: #![feature(lang_items, no_std, core)]
#![no_std]
extern crate core;
#[lang = "stack_exhausted"]
extern {}
#[lang = "eh_personality"]
extern {}
#[lang = "panic_fmt"]
extern {}
#[lang = "start"]
fn main() {} $ rustc main.rs
Incorrect number of arguments passed to called function!
call void @_ZN4main20hb92ff91aa006d85cgaaE(i8* bitcast (void ()* @_ZN4main20hb92ff91aa006d85cgaaE to i8*), i64 %0, i8** %1)
Function return type does not match operand type of return inst!
ret void <badref>
i64LLVM ERROR: Broken function found, compilation aborted! That said, I'm not really sure what the expected behaviour is. |
It sounds like the stack overflow has been fixed and otherwise the error here is the signature of the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
I’m playing with making a bare-metal executable in rust. I fully admit to not knowing what I’m doing, but I thought this was worth reporting given that it resulted in a stack overflow in rustc. This was produced with the rust nightly from 2014/1/10. I’m on OS X 10.10.1 and installed rustc from the OS X .pkg flle.
Here’s how I invoked the compiler:
Here’s spin.rs:
The text was updated successfully, but these errors were encountered: