-
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
LLVM assertion when redefining a symbol with a different type #10883
Comments
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 is a standalone test case, modulo requiring rust-core to work. When I run:
I get the LLVM assertion |
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. |
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:
|
Updated the issue description |
I don't think this is a bug - a symbol is being redefined that's already in an |
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. |
When I change
|
@jvns: It's still not the same signature. The |
Oh, that makes sense =) It would definitely be nicer if Rust detected this and printed a error message. |
The only way to cause this is |
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. |
Doesn't reproduce. |
I'm getting this LLVM assertion:
when I try to compile
example.rs
:To reproduce:
The text was updated successfully, but these errors were encountered: