I\'m trying to run the following example to Compile, Assemble and Disassemble an small program using the LLVM tool chain.
My intention is to learn how it works so in
Make sure your llvm-gcc's version match the version of LLVM you installed - the binary IR format changes quite fast and is not backward compatible across several version.
Alternatively, you might try to emit text representation of LLVM IR out of llvm-gcc and assemble it through llvm-as.
Something like this:
llvm-gcc -emit-llvm -S foo.c -o foo.ll
llvm-as foo.ll -o foo.bc
llc foo.ll -o foo.S
etc.