Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upLLVM assertion when redefining a symbol with a different type #10883
Comments
This comment has been minimized.
This comment has been minimized.
|
In compiling just your code in the snippet, everything works just fine, so there may be some problem in the rest of the codebase. It would be great if this could be minimized from a large project to just a small standalone test case. Regardless, thanks for the report! |
This comment has been minimized.
This comment has been minimized.
|
This is a standalone test case, modulo requiring rust-core to work. When I run:
I get the LLVM assertion |
This comment has been minimized.
This comment has been minimized.
|
Oh yes, it is standalone, but that's a large amount of code to debug and it's not clear to me what in the code you have written is causing the assert. I'd try to emphasize the minimization over the standalone-ness right now. |
This comment has been minimized.
This comment has been minimized.
|
okay, I've improved it :) thanks! The problem actually just seems to be with the function name. #[no_std];
#[feature(macro_rules)];
#[path = "rust-core/core/mod.rs"]
mod core;
// Naive malloc
#[no_mangle]
pub unsafe fn malloc(len: uint) {}
pub fn main() {}So interestingly, if I replace "malloc" with "panda" here, I get quite a different error:
|
This comment has been minimized.
This comment has been minimized.
|
Updated the issue description |
This comment has been minimized.
This comment has been minimized.
|
I don't think this is a bug - a symbol is being redefined that's already in an |
This comment has been minimized.
This comment has been minimized.
|
Ah yes, I can see where LLVM would assert on that. Rust should be able to detect this, however, and possibly print a nicer error message about what just happened. |
This comment has been minimized.
This comment has been minimized.
|
When I change
|
This comment has been minimized.
This comment has been minimized.
|
@jvns: It's still not the same signature. The |
This comment has been minimized.
This comment has been minimized.
|
Oh, that makes sense =) It would definitely be nicer if Rust detected this and printed a error message. |
This comment has been minimized.
This comment has been minimized.
|
The only way to cause this is |
alexcrichton
referenced this issue
Aug 11, 2014
Closed
LLVM assertion failure for creating extern fns with same name but different signatures #16403
SSheldon
referenced this issue
Aug 21, 2014
Closed
Can't implement the same method for multiple classes #4
steveklabnik
added
the
A-diagnostics
label
Jan 23, 2015
klutzy
referenced this issue
Feb 24, 2015
Closed
ICE when #[no_mangle] function is declared multiple times with different signatures. #18358
This comment has been minimized.
This comment has been minimized.
|
I think #![crate_type="rlib"]
extern {
fn malloc(len: usize) -> *mut u8;
}
#[export_name="malloc"]
pub fn _malloc(len: usize) {}is an equivalent minimal test case. |
This comment has been minimized.
This comment has been minimized.
|
Doesn't reproduce. |
jvns commentedDec 9, 2013
I'm getting this LLVM assertion:
when I try to compile
example.rs:To reproduce: