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

Basic Block in function [...] does not have terminator! #32436

Closed
carlpaten opened this issue Mar 23, 2016 · 1 comment
Closed

Basic Block in function [...] does not have terminator! #32436

carlpaten opened this issue Mar 23, 2016 · 1 comment

Comments

@carlpaten
Copy link

Building CRust-OS/CRust-OS breaks with the following error:

cargo build --target x86_64-unknown-xen
   Compiling crust v0.1.0 (file:///home/carl/crust)
Basic Block in function '_ZN4main20h54d5823f086aab05fVcE' does not have terminator!
label %resume
LLVM ERROR: Broken function found, compilation aborted!
error: Could not compile `crust`.

To learn more, run the command again with --verbose.

To reproduce: multirust update nightly, git clone Crust-OS, make.

Tested on the following versions:

rustc 1.9.0-nightly (02310fd31 2016-03-19)
rustc 1.9.0-nightly (21922e1f4 2016-03-21)
@alexcrichton
Copy link
Member

Reduced down to this:

#![feature(lang_items)]                                
#![feature(alloc)]                                     
#![no_std]                                             

extern crate alloc;                                    

use alloc::boxed::Box;                                 

pub fn foo(s: Box<i32>) {                              
    bar();                                             
}                                                      

pub fn bar() {}                                        

#[lang = "eh_unwind_resume"]                           
pub unsafe extern fn eh_unwind_resume(_args: *mut u8) {
}                                                      

I believe the fix is to have the eh_unwind_resume function return ! and then make it just loop {} (or compile with -Z no-landing-pads)

Otherwise the assert is covered by #9307, so I'm gonna close in favor of that. Thanks for the report though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants