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

Output of --emit-llvm -S won't assemble with llvm-as #2167

Closed
brson opened this issue Apr 9, 2012 · 4 comments
Closed

Output of --emit-llvm -S won't assemble with llvm-as #2167

brson opened this issue Apr 9, 2012 · 4 comments
Labels
A-codegen Area: Code generation

Comments

@brson
Copy link
Contributor

brson commented Apr 9, 2012

If I generate the llasm for run-pass/hello.rs and run it through the in-tree version of llvm-as I get the following error:

hello.ll:10:31: error: invalid type for global variable
@rust_start = external global i32 (void (i1*, { i32, %tydesc*, i8*, i8*, i8 }*, { i32, i32, [0 x { i32, i32, [0 x i8] }*] }*)*, i32, i32, { i32, [2 x i32] }*)

The .bc file works fine.

@lht
Copy link
Contributor

lht commented Apr 9, 2012

I get the same error if dissembled the .bc file with llvm-dis and assemble back.

@brson
Copy link
Contributor Author

brson commented Apr 9, 2012

Not sure why we're declaring a global pointer to rust_start anyway. Seems like we should be declaring the rust_start function.

declare i32 @rust_start (void (i1*, { i32, %tydesc*, i8*, i8*, i8 }*, { i32, i32, [0 x { i32, i32, [0 x i8] }*] }*)\
*, i32, i32, { i32, [2 x i32] }*)  

lht added a commit that referenced this issue Apr 9, 2012
@lht
Copy link
Contributor

lht commented Apr 9, 2012

I realized the global thing is not a pointer, just a function. Look closely, it lacks a trailing star. :)

LLVM LLparser should be correct to reject this.

@brson
Copy link
Contributor Author

brson commented Apr 9, 2012

Fixxed!

@brson brson closed this as completed Apr 9, 2012
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 22, 2022
Check that diagnostics happen in the line that they are annotated for

fixes rust-lang#2131
celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
This will allow us to retrieve crash information from Kani driver once we merge rust-lang#2166.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation
Projects
None yet
Development

No branches or pull requests

2 participants