Apparently there are no precompiled binaries for llvm-gcc 4.0 for Linux.
I've tried downloading the sources and building according to http://llvm.org/docs/CFEBuildInstrs.html (except I'm not an elite gcc hacker). I tried following the guidelines and got what looks like a gcc for x86 with no traces of LLVM. I tried passing --enable-llvm with various llvm root pathnames and got ICEs.
Is it possible to download llvm-gcc 4.0 binaries for Linux? If it isn't, is there something new one should know in order to build them that didn't make it into the documentation?
As far as I’m aware the gcc 4.0 frontend is currently only supported on Darwin/OSX. Having said that, people have managed to get it to run on linux. If you look at this post in the mailing list archives http://lists.cs.uiuc.edu/pipermail/llvmdev/2006-April/005642.html it describes how to compile the frontend on linux. I hope that helps.
As others have already mentioned, it is possible to build it on a number of other configurations. I'd like to add though, that getting it to work on new platforms should be pretty easy (if it doesn't already), and I'd be happy to apply patches to the tree.
Hmm, today I just tried compiling the llvm-gcc 4.0 frontend again on linux (Fedora Core 3 I believe) and I seem to be suddenly having the problem that Yossi Kreinin mentioned. The frontend seems to be using normal gcc to compile as I no longer get a bytecode file after compilation. When I pass the --version argument it claims to be the LLVM 4.0.1 frontend. Any ideas what might cause this? It was working just fine before, I don’t know what I did differently last time I compiled it.
llvm-gcc4 by default emits object files, just as gcc does. This is by
design. If you want to get bytecode output you need to use the --emit-
llvm-bc option. A complete list of the options that llvm-gcc4 supports
can be obtained with "llvm-gcc -v --help" (lots of output). Here are the
descriptions of the --emit-llvm options:
-emit-llvm Emit LLVM code to the .s file instead of
native
-emit-llvm-bc Emit LLVM IR to the output file instead of
native
Please note that I was successful today in building llvm-gcc4 on Linux
(FC3) and there is now a binary version available for Linux at:
llvm-gcc4 by default emits object files, just as gcc does. This is by
design. If you want to get bytecode output you need to use the --emit-
llvm-bc option. A complete list of the options that llvm-gcc4 supports
can be obtained with "llvm-gcc -v --help" (lots of output). Here are the
descriptions of the --emit-llvm options:
-emit-llvm Emit LLVM code to the .s file instead of
native
-emit-llvm-bc Emit LLVM IR to the output file instead of
native
Close. These are the arguments the cc1 tool. If you're running gcc directly, I'd suggest using:
Hmm, today I just tried compiling the llvm-gcc 4.0 frontend again on
linux (Fedora Core 3 I believe) and I seem to be suddenly having the
problem that Yossi Kreinin mentioned. The frontend seems to be using
normal gcc to compile as I no longer get a bytecode file after
compilation. When I pass the --version argument it claims to be the
LLVM 4.0.1 frontend. Any ideas what might cause this? It was working
just fine before, I don't know what I did differently last time I
compiled it.
- John
> I don't think anyone has successfully built llvm-gcc4 on
Linux yet. I've
> tried and failed.
I have
There was some patches, but I believe that they were all
merged in the
latest snapshot.
And I've just finished and uploaded llvm-gcc4 for Debian x86,
as part of the llvm package. The Debian source package
includes a build.sh script that automates all the steps of
building from source, too.