why crosstool use --with-newlib to build gcc-core

Dimitry Andric dimitry@andric.com
Thu Aug 17 08:54:00 GMT 2006


Bridge Wu wrote:
> I noticed crosstool-0.42 use --with-newlib to build gcc-core which
> will be used to build glibc. I wonder why --with-newlib is used since
> we are building glibc, not newlib. Who can interpret the  exact
> meaning of --with-newlib?

In older versions of gcc/configure, you will find the following snippet:

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

# If this is using newlib, then define inhibit_libc in LIBGCC2_CFLAGS.
# This prevents libgcc2 from containing any code which requires libc
# support.
inhibit_libc=
if { test x$host != x$target && test "x$with_headers" = x &&
     test "x$with_sysroot" = x ; } || test x$with_newlib = xyes ; then
       inhibit_libc=-Dinhibit_libc
fi

Ergo, the with_newlib option was "abused" to force the inhibit_libc
variable to be true; inhibit_libc makes sure the compiler doesn't use
any libc headers.

This was changed later, to check for an empty with-headers option:
http://gcc.gnu.org/viewcvs?view=rev&revision=67396

and later yet again, to check for with-headers=no:
http://gcc.gnu.org/viewcvs?view=rev&revision=70634

In summary: these days the --with-newlib option should not be needed,
but it's probably kept in crosstool for compatibility with older gcc
releases.

--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list