[llvmlinux] Generating linux kernel .bc files

Jan-Simon Möller jsmoeller at linuxfoundation.org
Sun Oct 5 07:46:07 UTC 2014

You can compile with
* make BITCODE=1          - Output llvm bitcode to *.bc files

Check the build-wrapper at


Am 05.10.2014 um 01:46 schrieb João Corrêa:
> Hi everyone,
> I've been able to successfully compile the linux kernel with clang-3.5. In
> order to run some analysis, I've been trying to generate the respective -bc
> files. Reading older mailing archive, I've seen that it is not possible to
> do that just adding the -emit-llvm -c to the compilation flags. Due to
> this, I've written a wrapper code that invokes the original clang-3.5 and
> later invokes clang-3.5 again with the emit-llvm -c flags for each file.
> I'm calling make with the flags CC=clang-3.5 HOSTCC=clang-3.5, properly.
> If my wrapper is called, I get an error, as if the command was generated
> for compilation with gcc (a few unrecognized flags). If I rename the
> wrapper to make sure that clang is called instead of it, the compilation
> occurs perfectly.
> I'm attacking a file with the output of a 'make CC=clang-3.5
> HOSTCC=clang-3.5 V=1'.
> Thanks a lot and any hint regarding this would be very useful.
> João.
> _______________________________________________
> LLVMLinux mailing list
> LLVMLinux at lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/llvmlinux

More information about the LLVMLinux mailing list