building every released version of GCC starting with 4.1.2, with appropriate matching glibc

Jonathan Wakely
Fri Apr 7 23:49:00 GMT 2017

On 8 April 2017 at 00:38, Toebs Douglass <> wrote:
> On 08/04/17 01:29, Jonathan Wakely wrote:
>> On 7 April 2017 at 17:26, Toebs Douglass wrote:
>>> I'm also not quite sure if the instructions are quite correct - or
>>> perhaps it is that the options being passed to GCC configure have
>>> misleading documentation.  For example, the use of "--with-newlib" seems
>>> most odd, since we're using glibc.
>> That's explained in the LFS docs:
>> "Since a working C library is not yet available, this ensures that the
>> inhibit_libc constant is defined when building libgcc. This prevents
>> the compiling of any code that requires libc support. "
> Yes.
> The GCC docs say this option is used when newlib is being used, rather
> than glibc.
> The LFS docs say, as above, that where a C library is not yet available,
> this option must be used.

No, it doesn't say it *must* be used, it says that using it has a
particular property which is needed. Not that it's the only way to
achieve that.

> These two descriptions do not make sense with regard to each other.

Yes they do. One says that --with-newlib is used when compiling
against newlib, but doesn't say precisely what the effects of that
option are.

The other says that one of the effects of --with-newlib is used for LFS.

Those two statements don't conflict, strictly speaking.

> It is fairly likely the LFS in fact knows something more about this
> option and is using it for a purpose other than that described by the
> GCC docs.

If you're going to spend the next ten years of your life rebuilding
various versions of gcc and glibc you probably want to get used to
looking at the build system and figuring out what things do. This is
from gcc/

# If this is a cross-compiler that does not
# have its own set of headers then define
# inhibit_libc

# If this is using newlib, without having the headers available now,
# then define inhibit_libc in LIBGCC2_CFLAGS.
# This prevents libgcc2 from containing any code which requires libc
# support.
: ${inhibit_libc=false}
if { { test x$host != x$target && test "x$with_sysroot" = x ; } ||
       test x$with_newlib = xyes ; } &&
     { test "x$with_headers" = xno || test ! -f
"$target_header_dir/stdio.h"; } ; then

More information about the Gcc-help mailing list