问题
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