llvm not generation byte code properly

删除回忆录丶 提交于 2019-12-24 02:30:31

问题


I've installed llvm 3.0 with llvm-gcc 4.6 on ubuntu 11.10. I'm trying to do the "example with llvm-gcc4" on http://llvm.org/docs/GettingStarted.html#tutorial4

But here's what I get:

buse@buseZenbook:~$ gcc --version
gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

buse@buseZenbook:~$ llvm-gcc --version
gcc-4.6 (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

buse@buseZenbook:~$ llvm-gcc hello.c -o hello
Potential incompatible plugin version. GCC: 4.6. Expected: 4.6.1
Defines 'dragonegg_disable_version_check' as env variable to remove this warning
Please note that unexpected errors might occur.

buse@buseZenbook:~$ llvm-gcc -O3 -emit-llvm hello.c -c -o hello.bc
Potential incompatible plugin version. GCC: 4.6. Expected: 4.6.1
Defines 'dragonegg_disable_version_check' as env variable to remove this warning
Please note that unexpected errors might occur.

buse@buseZenbook:~$ ./hello
Hello World!

buse@buseZenbook:~$ lli hello.bc
lli: hello.bc:1:1: error: expected top-level entity
ELF>�@@
^

And hello.c:

#include <stdio.h>

int main(){
printf("Hello World!\n");
return 0;
}

~ Any suggestions?

来源:https://stackoverflow.com/questions/9447318/llvm-not-generation-byte-code-properly

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!