compiling gcc using --with-headers pointing to linux headers

Conyers, Steve steve.conyers@lmco.com
Wed Apr 25 08:12:00 GMT 2001


Yeah, I blasted out all the old newlib stuff.  In fact, out of paranoia I
wasn't content with a "make distclean" so I even blasted the old sources and
"re-untarred" them.

I think there is a flaw in the --with-headers scheme.  The point where I
fail in the Makefile is 

/export/home/gnu-source/build-gcc/gcc/xgcc
-B/export/home/gnu-source/build-gcc/gcc/
-B/export/home/xc/powerpc-motorola-linux-gnu/bin/
-I/export/home/xc/powerpc-motorola-linu-gnu/include -O2 (etc, etc)
../../gcc-2.95.2/gcc/libgcc2.c (etc, etc)
 
But where NONE of the additional -I's point to
$target/powerpc-motorola-linux-gnu/sys-include which is where --with-headers
does its thing.  In the newlib case I was able to work around this by
creating a symbolic link 
#ln -s sys-include include
in the $target/powerpc-eabi directory.  This workaround didn't work when I
naively configured for gcc using
--with-headers=/export/home/linux-source/linux-2.2.17/include

The linux headers got copied over, but there was no stdlib.h anywhere to be
found in linux-2.2.17.  This seems quite peculiar.  Could it be that I need
to do a make on it using my native gcc to "flesh it out" header-wise before
using its headers for the cross compiler build???

Thinking I may have misinterpreted your advice, I tried configuring for gcc
using --with-headers=/export/home/gnu-source/glibc-2.2.2/include

The workaround of creating a link
#ln -s sys-include include 
in the $target/powerpc-motorola-linux-gnu directory sort of helped:  

When the compiler tried to compile libgcc2.c, it found a stdlib.h and a
unistd.h in $target/powerpc-motorola-linux-gnu/sys-include, but these
headers (from glibc) in turn referenced <stdlib/stdlib.h> and
<posix/unistd.h> which exist in glibc but did not get copied over to
sys-include.  I can try a --with-headers pointing at glibc-2.2.2 instead of
glibc-2.2.2/include or I can try some additional "linksmanship", or I can
try something else if anyone has a suggestion!!!

Regards, Steve Conyers

-----Original Message-----
From: David Korn [ mailto:dkorn@pixelpower.com ]
Sent: Wednesday, April 25, 2001 1:51 AM
To: 'Conyers, Steve'; 'jimk@scitechsoft.com'
Cc: Crossgcc-List (E-mail)
Subject: RE: compiling gcc using --with-headers pointing to linux
headers


>-----Original Message-----
>From: Conyers, Steve [ mailto:steve.conyers@lmco.com ]
>Sent: 24 April 2001 23:26

 [Crossgcc list Cc'd back in]

>#../gcc-2.95.2/configure -- target=$target --prefix=$prefix
>--with-headers=/export/home/linux-source/linux-2.2.17/include -v
>#make LANGUAGES=c
>
>the system did not find stdlib.h and unistd.h and blew me away.  This is
>the same error I use to get before creating links into newlib from 
>gcc-2.95.2.  
>
>The linux headers beneath linux-2.2.17/include did get copied over to
>subdirectories beneath $prefix/powerpc-motorola-linux-gnu/sys-include

  #1:  Have you removed the links to newlib?
         If not, rm them.
  #2:  Are the old newlib headers left over in $prefix/$target/sys-include?
         If so, zap them.
  #3:  Is there a file called COPIED in $prefix/$target/sys-include
         The headers are copied over at configure time, and this file is
    then created to indicate it has been done.  If there was one left
    over from your attempts with newlib, it would be noticed by configure
    when you tried again with the linux headers, and the result is that
    the linux headers wouldn't get copied.  So get rid of that one too.

          DaveK
-- 
 All your base are belong to the Israeli army!  Oh, now they aren't again!


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

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



More information about the crossgcc mailing list