[llvmlinux] Generating LLVM bitcode

Salim Bansal salim.bansal at gmail.com
Tue Aug 13 01:21:44 UTC 2013


I did
'git checkout dd1c9315f7d9ae6b83344e9642ada1ca31526e34'
to get the commit "Add support for out puting llvm bitcode to *.bc
files<http://git.linuxfoundation.org/?p=llvmlinux.git;a=commit;h=dd1c9315f7d9ae6b83344e9642ada1ca31526e34>"
while following the
steps from here http://llvm.linuxfoundation.org/index.php/Nexus_7 to build
android kernel and before doing 'make all'.
When I did 'make all' I got the following error:

[ 16%] Building CXX object lib/Basic/CMakeFiles/clangBasic.dir/Targets.cpp.o

~/llvmlinux/toolchain/clang/src/clang/lib/Basic/Targets.cpp: In function
‘clang::TargetInfo* AllocateTarget(const string&)’:

~/llvmlinux/toolchain/clang/src/clang/lib/Basic/Targets.cpp:5392:8: error:
‘mblaze’ is not a member of ‘llvm::Triple’

make[3]: *** [lib/Basic/CMakeFiles/clangBasic.dir/Targets.cpp.o] Error 1

make[3]: Leaving directory `~/llvmlinux/toolchain/clang/build/clang'

make[2]: *** [lib/Basic/CMakeFiles/clangBasic.dir/all] Error 2

make[2]: Leaving directory `~/llvmlinux/toolchain/clang/build/clang'

make[1]: *** [all] Error 2

make[1]: Leaving directory `~/llvmlinux/toolchain/clang/build/clang'

make: *** [~/llvmlinux/toolchain/clang/state/clang-build] Error 2

Is it because that the config.mk file is refering to a different commit of
llvmlinux or am I missing something else.





On Mon, Aug 5, 2013 at 7:14 PM, Behan Webster <behanw at converseincode.com>wrote:

> On 08/05/13 17:29, Salim Bansal wrote:
>
>> I am trying to generate llvm bitcode for Android kernel/drivers.
>> I followed this how-to http://llvm.linuxfoundation.**
>> org/index.php/Nexus_7 <http://llvm.linuxfoundation.org/index.php/Nexus_7>to
>> build Android kernel with LLVM.
>>
>> How can I pass the "-emit-llvm" flag so that it generates .bc bitcode
>> files as part of
>> building kernel/drivers ?
>>
> If you do another pull of the LLVMLinux repo, I just pushed the ability to
> do so (something I've had half done for a while)
>
>     targets/x86_64/$ make BITCODE=1 all
>
> The above should create *.bc files next to all the *.o files (where
> possible). Sadly it makes the compile take a lot longer since it has to run
> the compiler twice on every file (once to create the *.bc file and once to
> create the *.o file otherwise Kbuild would break).
>
> It appears to work to me, so let me know if it doesn't do what you expect
> it to do.
>
> Behan
>
> --
> Behan Webster
> behanw at converseincode.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfoundation.org/pipermail/llvmlinux/attachments/20130812/f5926415/attachment.html>


More information about the LLVMLinux mailing list