llvm-gcc 4.0 for Linux@x86

Hi!

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?

Thanks in advance!
-- Yossi

I don't think anyone has successfully built llvm-gcc4 on Linux yet. I've
tried and failed.

The instructions in CFEBuildInstrs.html are for llvm-gcc3 and probably
won't work as-is.

Reid.

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.

  • John

Hello, Reid.

You wrote Saturday, June 3, 2006, 10:25:13 PM:

I don't think anyone has successfully built llvm-gcc4 on Linux yet. I've
tried and failed.

There was some message in this list saying, that bootstrap was
succeeded on linux.

I've successfully built and used llvm-gcc4 on linux/alpha

Andrew

Okay! I stand corrected. :slight_smile:

Reid.

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.

-Chris

I have :slight_smile:
There was some patches, but I believe that they were all merged in the
latest snapshot.

Rafael

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

Hi John,

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:

http://llvm.org/2006-06-01-llvm-gcc4-linux-x86-binary.tar.gz

Reid.

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:

llvm-gcc t.c -emit-llvm -S -O3 -o t.ll
llvm-gcc t.c -emit-llvm -c -O3 -o t.bc

Basically, with -emit-llvm, -S emits a .ll file, and -c emits a .bc file.

-Chris

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:

http://llvm.org/2006-06-01-llvm-gcc4-linux-x86-binary.tar.gz

Reid.

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 :slight_smile:
        There was some patches, but I believe that they were all
        merged in the
        latest snapshot.

        Rafael
        _______________________________________________
        LLVM Developers mailing list
        LLVMdev@cs.uiuc.edu http://llvm.cs.uiuc.edu
        http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

--
John Trimble
Research Assistant
University of Arizona
_______________________________________________
LLVM Developers mailing list
LLVMdev@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-Chris

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.