llvm没有正确生成字节码

时间:2012-02-25 19:30:20

标签: llvm

我在ubuntu 11.10上安装了llvm 3.0和llvm-gcc 4.6。我正试图在http://llvm.org/docs/GettingStarted.html#tutorial4

上做“llvm-gcc4的例子”

但这就是我得到的:

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>�@@
^

和hello.c:

#include <stdio.h>

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

〜 有什么建议吗?

0 个答案:

没有答案