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
Crash handling bitcode #8061
Comments
Could you update to r109036 and post the output on this testcase? |
Sure, the output is: @skel = global [1 x i8*] zeroinitializer ; <[1 x i8*]*> [#uses=0] Unknown constant! |
Fixed in r109117. |
I still get the same failure: @skel = global [1 x i8*] zeroinitializer ; <[1 x i8*]*> [#uses=0] Unknown constant! |
I program that should allow you to reproduce without gold: #include <assert.h> lto_code_gen_t cg = lto_codegen_create(); Just pass the test.bc file to it and lto_codegen_write_merged_modules will abort with the same error message. |
This is related to llvm/llvm-bugzilla-archive#7700 . |
Fixed in r111949 and related commits. |
With those patches, the test case in the original description gave me these: @skel = global [1 x i8*] zeroinitializer ; <[1 x i8*]*> [#uses=0] Unknown constant! Does anyone else see the same result? |
That UNREACHABLE is no longer at line 909 in BitcodeWriter.cpp on ToT; are your sources up to date? |
This UNREACHABLE disappeared. Thanks. The reason is that I did not replace those old LLVMgold.so and libLTO.so. But I got the following: |
Missing lto_codegen_set_cpu is a separate gold plugin issue. Please use new PR. |
I fixed this by adding lto_codegen_set_cpu and lto_codegen_set_assembler_args to lto.exports Then I still got the Unknown constant! by doing: $ llvm-gcc -use-gold-plugin -Wl,-plugin-opt=also-emit-llvm -O4 -g conftest.c declare i32 @main() nounwind readnone Unknown constant! |
It turns out there was another bug in bitcode linking. This is now fixed in r112091. I updated lto.exports too. |
I compiled httpd-2.2.9.tar.gz using the latest code. It compiles without problem, however, I got a lot of "BFD: Dwarf Error: Could not find abbrev number" when I do objdump. It is configured with: then I make then go to .libs and do I did get one httpd.S though. |
Please file a new bug with an example of a bitcode file that produces a .o with broken debug info. Thanks! |
http://llvm.org/bugs/show_bug.cgi?id=8003 I haven't reduce it to a single bytecode file. Instead I uploaded a tarball of bytecode files that can be linked to get the final binary. |
Extended Description
This shows up with the gold plugin, but I don't think it is gold specific:
$ cat test.ll
@skel = global [1 x i8*] [i8* null]
!llvm.dbg.gv = !{#0}
!0 = metadata !{i1 true, [1 x i8*]* @skel}
$ llvm-as test.ll -o test.o
$ ld -plugin LLVMgold.so -o flex -shared -plugin-opt=emit-llvm test.o
Unknown constant!
UNREACHABLE executed at /usr/local/google/home/espindola/llvm/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:904!
Aborted
The text was updated successfully, but these errors were encountered: