Re: Building a cross compiler, and unsure about the use of --without-headers

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

 



16.3.2011 11:15, David Paterson kirjoitti:
On Wed, Mar 16, 2011 at 12:47 AM, Ian Lance Taylor<iant@xxxxxxxxxx>  wrote:
David Paterson<dnpaterson@xxxxxxxxx>  writes:

Based on various examples of building cross systems around the net, I
have a procedure where the compiler gets built twice, once as a basic
version to allow building of Newlib, and then again as the full cross
compiler version.  Looking at the esamples, the first, basic, build
always seems to use --without-headers (and --with-newlib).  For the
second build however, some sites have both of these again, while
others have only --with-newlib, so I'm not sure whether I should
include this option in my second stage build or not...

A search turns up a few references to this option, but none of them
say much beyond something along the lines of "leaving it out will
disable some features".  Does anybody have any thoughts on the wisdom
or otherwise of using this option?

--without-headers is the default, so it doesn't really matter whether
you specify it or not.

Ian

Ah, I didn't think to check the defaults...  Thanks for the quick
response Ian :-)

Needing to build twice is of course also very weird suggestion :(

Producing newlib-based GCCs for embedded systems from scratch has
succeeded in only one stage during the last 20 or so years, I
remember building my 1st one in early 1990's and then without any
know-how I maybe had to do more than one "iteration" :(

Basically one only needs to have the generic newlib headers (from
'newlib/libc/include' in the newlib-x.y.z sources) available during
the GCC build. Or the whole 'newlib' and 'libgloss' sources in the
main GCC source dir if wanting to build newlib at the same time
with the GCC... Then the whole GCC, C & C++ compilers, libgcc,
libstdc++ etc. will be built in only one build stage! Without or
with newlib...

So I guess the instructions being written by newbies who have just
succeeded with their first crosstoolchain and want to share their
"know-how" with others. Not by people who have built 100's of
newlib-based crosstoolchains for some reasons, just-for-a-fun or
for more serious ones...

The only thing hinting to a need to produce 'libstdc++' etc. after
having newlib built and installed is that the generic newlib headers
aren't the final ones. Here a diff made from the 'sparc-elf' case
during the newlib-1.13.0 time :

[root@localhost sparc-elf]# diff -rc /hd80g/data1/home/src/newlib-1.13.0/newlib/libc/include include.sav
Only in include.sav/machine: sparclet.h
diff -rc /hd80g/data1/home/src/newlib-1.13.0/newlib/libc/include/newlib.h include.sav/newlib.h *** /hd80g/data1/home/src/newlib-1.13.0/newlib/libc/include/newlib.h 2002-08-29 02:42:53.000000000 +0300
--- include.sav/newlib.h        2005-01-13 11:23:53.000000000 +0200
***************
*** 1,2 ****
! /* dummy file for external tools to use.  Real file is created by
!    newlib configuration. */
--- 1,142 ----
! /* newlib.h.  Generated automatically by configure.  */
! #ifndef __NEWLIB_H__
!
! #define __NEWLIB_H__ 1
!
! /* EL/IX level */
! /* #undef _ELIX_LEVEL */
!
! /* Newlib version */
! #define _NEWLIB_VERSION "1.13.0"
.....

During my last 'sparc-elf' target build (just checking), I only
copied the generic newlib headers (with a single 'cp -r') and
built GCC, libgcc, libstdc++ etc. with only them... Building and
installing newlib would give the diff for the current situation
and if then rebuilding 'libgcc', 'libstdc++' again would tell
there being any difference to the "with bare generic headers"
results, maybe then there would be some idea in that 2-stage
process...

So although the build with the generic newlib headers will work,
there is that suspect: "It cannot be this easy, something must
be wrong!". For the paranoids there are the steps :

1. build and install only GCC and libgcc

2. build and install newlib

3. continue the GCC build process via 'make ; make install'

But also these steps will produce the GCC only once, continuing
after a short coffee break for the paranoid's nerves...

Of course if one puts the 'newlib' and 'libgloss' among the GCC
sources, then everything should appear during the first build
and be fully right!


[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