[LLVMdev] building gcc with clang/llvm

2,132 views
Skip to first unread message

reed kotler

unread,
Sep 21, 2012, 7:34:35 PM9/21/12
to llv...@cs.uiuc.edu
Has anybody tried building gcc using clang/llvm as the first stage compiler?

Tia

Reed

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

Brooks Davis

unread,
Sep 21, 2012, 8:07:51 PM9/21/12
to reed kotler, llv...@cs.uiuc.edu
On Fri, Sep 21, 2012 at 04:34:35PM -0700, reed kotler wrote:
> Has anybody tried building gcc using clang/llvm as the first stage compiler?

On FreeBSD we build gcc 4.2 with clang when clang is the system
compiler. The build process differs from the normal gcc build process
so the final gcc is built directly with clang. We do compile gcc
without -Werror because clang generates a lot of warnings (presumably a
modern gcc would as well).

--- Brooks

Reed Kotler

unread,
Sep 22, 2012, 8:14:34 PM9/22/12
to llv...@cs.uiuc.edu
On 09/21/2012 04:34 PM, reed kotler wrote:
> Has anybody tried building gcc using clang/llvm as the first stage
> compiler?
>
> Tia
>
> Reed

I tried this and it seems to work.

Just:

export CC=<bin for clang>

and then when you run configure for gcc, it will use clang for the first
stage.

There were some warnings but the results several phase bootstrapped gcc
seemed to work.

Diego Novillo

unread,
Sep 28, 2012, 10:08:08 PM9/28/12
to reed kotler, llv...@cs.uiuc.edu
On 2012-09-21 16:34 , reed kotler wrote:
> Has anybody tried building gcc using clang/llvm as the first stage
> compiler?

Works fine with

Ubuntu clang version 3.0-6ubuntu3 (tags/RELEASE_30/final) (based on LLVM
3.0)
Target: x86_64-pc-linux-gnu
Thread model: posix

Build with:

$ CXX=clang++ CC=clang ../src/configure
$ make -j


Diego.
Reply all
Reply to author
Forward
0 new messages