Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why I received the error "llvm-dis: Invalid bitcode signature"

Tags:

llvm

clang

clang hello_world.c -S -emit-llvm -o hello_world.bc
llvm-dis hello_world.bc

I would like to generate human readable ll file using llvm-dis, but I received the erorr

llvm-dis: Invalid bitcode signature

like image 350
Adam Lee Avatar asked Feb 10 '23 10:02

Adam Lee


1 Answers

With the -S option, clang already produces human-readable LLVM assembly. So your .bc file does not actually contain bitcode, which is why llvm-dis can't read it.

like image 142
sepp2k Avatar answered Apr 01 '23 15:04

sepp2k