Re: Toolchain bootstrapping advice needed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2011-08-09 at 01:43 -0700, Bryan Ischo wrote:
> I've recently embarked upon a possibly futile effort to create a script 
> to bootstrap a GNU toolchain - binutils, gcc, and glibc - from a system 
> with the most minimal of prerequisites.
So am I! 


> I'm trying to build a single script that can build a 
> toolchain for any arbitrary combination of build, host, and target 
> system type.
Cue the "just use crosstools" comments. Crosstools purports to do
exactly that. I've found it doesn't fit my needs, but maybe it will fit
yours. I want to do what you are doing, but going one step further:
capturing all the toolchain requirements in a form that will let me
regenerate it ten years later without external servers (which is hard
with crosstools).
> 
> I've gotten pretty far, although it's taken quite a long time to 
> understand the intricate dance that must be performed to bootstrap gcc 
> and glibc, and also has required some patches to glibc, mostly to get 
> past what I consider to be a deficiency in its autoconf scripts: namely, 
> that they error out on tests that check for a working linker when in 
> fact glibc ought to be buildable without any liker at all (although its 
> utility programs can't be built, but those aren't necessary during the 
> bootstrapping process).
I've lamented this as well. It seems to me that the glib and gcc
developers spend much of their time incrementally improving gcc and glib
on their systems, and IMHO not enough time practicing a full bootstrap
(let alone a cross compile).

>   At this point I can produce a working binutils 
> and glibc, but the "final" build of gcc is giving me some problems that 
> I am still working through.
Can I as what targets you are building for? I've had some success with
most of the targets, but building X86_64 as a cross compile has given me
quite a bit of grief.
> 
> 1. Build binutils
> 2. Build stage1 gcc, building just the "gcc" and "install-gcc" targets, 
> not the full build (which would try to compile libraries that require 
> glibc, which has not yet been built)
> 3. Build stage1 glibc using the stage1 gcc compiler; this uses the 
> binutils from (1) and the stage1 gcc from (2).  This version of glibc is 
> built with only static libraries and without any of the helper programs 
> of glibc, because the stage1 gcc cannot build shared libraries or 
> executables.
> 4. Build stage2 gcc against the stage1 glibc, with executable and shared 
> library support, but without libmudflap which cannot be built against 
> the purely static stage1 glibc.
> 5. Build final glibc with stage2 gcc, this is a complete and final glibc 
> with shared library support and support of all features.
> 6. Build final gcc against final glibc, which is a complete gcc with 
> full support for all features.
You might look at the makefile I attached to a mail to this list just
yesterday - that's the sequence I'm following.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux