I am using the following commands to compile a source file(hello.c) into an executable file(hello), and expect to dump out the DWARF info of the executable file. However, there is no DWARF info no matter using "readelf -wi hello" or "llvm-dwarfdump hello". I am wondering where went wrong.
clang-3.5 -gdwarf-4 -O0 -emit-llvm -c hello.c -o hello.bc
llc -dwarf-version=4 -O0 -filetype=obj hello.bc
gcc hello.o -o hello
The problem was due to the mismatching between clang and llvm. I was using llvm-3.9 with clang-3.5. I solved by upgrading clang-3.5 to clang-3.9. Specifically, I added clang-3.9 to llvm_src/tools and then recompiled llvm.