This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch to move cross-compilation documentation from install-old.texi

After building hundreds of cross-GCCs, I have some opinions about
this issue... 

"Joseph S. Myers" <> wrote:

> +If you are not building a C library in the same source tree as GCC,
> +you should also provide the target libraries and headers before
> +configuring GCC, specifying the directories with
> +@option{--with-sysroot} or @option{--with-headers} and
> +@option{--with-libs}.

 The '--with-headers' has been considered being horrible rubbish and
not recommended to be used when building a cross-GCC.  First the
current use of the 'sys-include' (using '--with-headers' causes the target
headers to be copied there), clashes against the de-facto standard of
the '$(tooldir)/include' being the place for the standard target headers:

 Quoting the 'gcc/doc/headerdirs.texi' :

" A cross compiled GCC runs @code{fixincludes} on the header files in


"For a cross-compiler, this is the equivalent of @file{/usr/include}.
 When you build a cross-compiler, @code{fixincludes} processes any
header files in this directory."

 So 'fixincludes' searching the 'sys-include' has been a serious bug for
a long time, and this bug should finally be fixed!

 The 'fixincludes' hasn't worked as it should, producing garbage from
the originally working headers, so cross-GCC builders have learned
to avoid putting anything into the 'sys-include'. But currently putting
the 'limits.h', 'stdlib.h' and 'unistd.h' to be seen existing during the GCC
build, has been obligatory. Of course if 'fixincludes' handles the
'/usr/include' OK in the native case, it should handle the
'$tooldir)/include'  with just the same headers OK too... The first
guesses about the 'sys-include'-case were that it was left to the builder
to decide whether to try to fix the target headers or not...  But if there
was not any 'native case', as was the case with the embedded newlib
using GCCs, the target headers from newlib SHOULDN'T ever put
into the 'sys-include' because one couldn't know what horrible things
the 'fixincludes' could now do to them...

 With those 'system' target cases fixing the target headers has been
obligatory and the 'sys-include' being symlinked to point to 'include'.
But with glibc, it has been wiser to expect the GNU C library already
being fixed for GCC... If not, then fix the bugs the fixincludes found
and continue with fixed glibc headers (like the 'pthread.h' and
'bits/sigthread.h' having their '__thread's renamed in glibc-2.2.5). 

 If we look at the current attitudes among the GCC-developers :

 o  a cross-GCC builder is an idiot who cannot use 'copy' or 'cp' to
    copy target stuff into '$prefix/$target/include' and '$prefix/$target/lib'
    after configuring binutils with:

     --prefix=$prefix --target=$target

   and building & installing them. But the idiot can write '--with-headers'
   and '--with-libs' into the GCC-configure command... It will be a big
   mystery how the places the '--with-...' point to, were filled with the
   target headers and libs, when the builder cannot copy anything,

 o  a cross-GCC builder was also born as a pagan, was educated in all
     the native pagan habits and knows only the native ways when
     suddenly obliged to go to the land of cross... One is like a native
     coming into a wacky land full of Christians following bad cross
     habits and therefore wants to keep the old good 'native' habits there.
     The Cristian habits like drinking wine in churchs and homes,
      meanwhile burning grass is a big crime, may clash badly with the
      original native habits with all alcohol being forbidden and 'hashis'
      being allowed... But the people in the land of cross may take the
      native habits as bad and ugly....

 Taking the cross-GCC builders as idiots or "funny natives with their
own peculiar habits" (what the GCC-developers may be), may though
cause resistance among the cross-GCC builders and users, who don't
feel being either idiots or funny natives...

 The '--with-sysroot' tries to bring the native habits into the "peaceful
land of cross"... So I think that all kind of "skinheads" like me could try
to resist spreading this new native idea with all the possible means...

 Is the cross-GCC model really so bad ?  If so why the models borrowed
from the mostly proprietary "native 'cc's" are so good and beautiful?

Cheers, Kai

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]