[llvm-dev] unable to compile llvm with gcc 4.7.4
Daniel Berlin via llvm-dev
llvm-dev at lists.llvm.org
Mon Oct 17 11:44:38 PDT 2016
On Mon, Oct 17, 2016 at 11:28 AM, Renato Golin via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> On 17 October 2016 at 19:09, Flamedoge via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > Just for the interest of discussion, I find it completely weird and
> > interesting that GCC needs to build itself 3 times to fully bootstrap.
> Has
> > there been any interest in looking at a single compile build?
(I know renato did not write this, but i'll just answer this here)
This is deliberate and necessary if you want to be sure.
You can do a single compile build by just "not bootstrapping".
The reason boostrapping is 3 stages is to find optimizer bugs.
stage 1: Compile new compiler
stage 2: Compile self with new compiler // IE detect any obvious bugs in
new compiler, like ICE, etc
stage 3: Compiler self with stage 2 compiler // IE detect miscompiles
caused by new compiler being broken
Stage 2 and 3 should be identical, if they aren't, you have a minimum of
non-determinism, and more likely, a codegen bug somewhere.
Otherwise, stage2 could be very broken and you may not notice, because the
compiler has relatively few compile + execute tests (since they are very
hard to write)
Instead, they rely on the one large execution test they know they can use:
the compiler itself.
Note that 3 stage bootstraps are a technique that predates gcc :)
> I don't
> > exactly know the limitations, but my naive thinking is that C++14
> compiler
> > source parsed by C++14 capable compiler and codegen'd to C99 (or older)
> > source should make it compilable by older compilers. Is this just a
> delusion
> > or an actually useful idea?
>
> Far from being an expert, my understanding is that this is largely due
> to the libraries and tools.
>
> GCC has a reduced sub-set of the compiler that works with many old
> compilers, and they build that one first, then use that one to build
> the required libraries, tools, and the complete compiler, than use the
> complete compiler to bootstrap.
This is not correct :)
First stage of gcc is the entire compiler, not a subset or a different
compoiler.
You can also have cross-bootstrap, or
> Canadian cross, which increase the complexity of the builds by a
> reasonable margin.
>
> LLVM doesn't do that because we rely on the system's libraries, which
> honestly is a bad habit. This bad habit made the edges between RT,
> libc++ and LLVM a bit rough, especially when cross compiling and
> re-using those tools to bootstrap. It also makes it very hard to have
> stable tests, especially in between "package upgrades".
>
> It should be possible to bootstrap Clang in only two stages, but that
> requires a lot of CMake magic if we want to get *all* components
> built, including RT, libc++ and lld.
>
> However, none of that mentions the C library, which is a whole new
> problem if Clang can't compile it. I believe we still can't compile
> the GNU C library, but we can compile Musl (at least for some
> targets), so we could include Musl on such a two-stage magical
> bootstrap...
>
> But that's a lot of work... :)
>
> cheers,
> --renato
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161017/7c96ab41/attachment.html>
More information about the llvm-dev
mailing list