This is the mail archive of the crossgcc@sourceware.cygnus.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


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

Re: Still can't find the target headers


Thunder Scientific Corporation wrote:
> 
> Kai Ruottu just posted a comment to this list about finding target headers.
> He included a clip from the documentation for gcc 2.96:

 The 'gcc-2.96' means the current egcs-snapshots, it gives the version
as
'gcc-2.96 (experimental 200xxyy)' and is available via :

    ftp://sourceware.cygnus.com/pub/egcs/snapshots

or any of the mirrors....
 
> This sounds like a good idea to me.  As it happens, I too am having problems
> trying to build a cross compiler.  Therefore, I tried exactly that.  First,
> I built and installed binutils-2.9.5.0.34 to <prefix>/bin, with <prefix> as
> defined below.

 Unfortunately there is a bug in gcc-2.95.2 which spoils this. The added
new
'relative-path' system needs more '-B<directory>' or '-I<directory>'
options
during the build to point to the headers. The 'hacks' or work-around's
are to
use the '--with-headers' or pre-creating the GCC 'install' directory :

    $prefix/lib/gcc-lib/$target/2.95.2  

 Using the './xgcc -print-search-dirs' after 'xgcc' has been built and
when it
tries to build 'libgcc2.a' and fails to find the headers, will show what
is the
problem...

 It is the route via the 'install' directory to the
'$prefix/$target/include',
not going straight to it (as earlier). A native compiler hasn't this
problem because
the 'target' headers for it are always in the absolute '/usr/include'
(if not, the
'specs' has the directory defined as '/usr/ccs/include' or something...)

 I remember sending you an explanation for this as "Richard the
Lionheart trying to
find Jerusalem and trying to go there via New York..." If Richard would
live now,
there wouldn't be problems, but in the time he lived there would have
been...
Just as GCC has with finding the '$prefix/$target/include' when it is
given as :

  $prefix/lib/gcc-lib/$target/2.95.2/../../../../$target/include

and the 'install' directory doesn't yet exist...  Perhaps it wasn't
clear what I
meaned, but let's hope it is now...

>  But I still can't build gcc.  The attempt to make libgcc2
> fails because it still can't find the header files, yet they're right where
> (I think) they're supposed to be, in /usr/local/<target>/include.

 By gcc-2.95.2 sources have had the 'bug' fixed by adding one '-B'
option or
one '-I' option more to the 'GCC_FOR_TARGET = ....', 'CXX_FOR_TARGET =
...'
etc. in 'gcc-2.95.2/Makefile.in' since the last summer (added to the
gcc-2.95
sources then, having them there caused no rejected patches when patching
to
gcc-2.95.1 and gcc-2.95.2)...

 So I would ask you to use something like 'make CFLAGS="-v -O"' while
trying
the build again, after it stopped with the target headers not being
found, and
post the '.../xgcc -B./ ....' command line it used. Just to verify what
is
the problem with the 'plain vanilla' gcc-2.95.2 sources.

Cheers, Kai


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


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