Problems when building gcc 3.2or 3.3 as cross compiler for powerpc-linux

Richard Sewards richard.sewards@navtelcom.com
Tue May 27 15:39:00 GMT 2003


Yes, I did provide the linux headers. I used 2.4.20.  The ucontext.h in
the linux headers is in asm-ppc/ucontext.h but config/rs6000/linux.h is
looking for sys/ucontext.h.  The one in the kernel headers is quite
different.  rs6000/linux.h is also using "struct sigcontext" which is
eventually found in asm/sigcontext.h but the headers are used such that
the glibc header files are needed to eventually get to asm/sigcontext.h.


I think I have found a solution by adding more steps:  I install the
partially built minimal gcc (without libgcc.a) and use this to build
glibc.  This fails because it cannot create the shared objects (it needs
libgcc.a).  However, if I do "make -k ; make -k install" I get an
installed set of header files.  I then combine these with the kernel
headers and use this new header collection (using --with-headers=...) to
reconfigure the minimal gcc, which now builds successfully. 

So the next steps are to rebuild glibc again, and then build the
complete gcc.

I might try modifying gcc's config/rs6000/linux.h such that it doesn't
need the glibc headers as an alternate solution (probably a better one,
in fact).  It should include "linux/signal.h" and "asm/ucontext.h"
instead of "signal.h" and "sys/ucontext.h", but there may be other
structures used too.

Regards,

--
Richard Sewards 

-----Original Message-----
From: Nick Patavalis [mailto:npat@inaccessnetworks.com] 
Sent: Monday, May 26, 2003 12:04 PM
To: gcc-help@gcc.gnu.org
Subject: Re: Problems when building gcc 3.2or 3.3 as cross compiler for
powerpc-linux

On Mon, May 26, 2003 at 11:48:35AM -0400, Richard Sewards wrote:
> Hi,
> 
> I have been trying to build 3.2.3 and 3.3 with glibc 2.3.2 as cross
> compilers (host i686-linux-gnu, target powerpc-linux-gnu) and I run
into
> header file problems when compiling libgcc2.c.  Specifically, I get:
> 
>     In file included from tconfig.h:22,
>                  from ../src/gcc/libgcc2.c:36:
>     ../src/gcc/config/rs6000/linux.h:86:20: signal.h: No such file or
> directory
>     ../src/gcc/config/rs6000/linux.h:87:26: sys/ucontext.h: No such
file
> or directory
> 
> I have been following the advice in Nick Patavalis' very helpful note,
> but this appears to be a powerpc specific issue.
>

Have you provided *linux kernel headers* when building the minimal
gcc?  I had similar (though I don't remember if they were *identical*)
problems when building for ARM, and they were corrected when I povided
kernel heareds to the minimal gcc build. Indeed, it seems that both
"ucontext.h" and a "signal.h" files *are* in the kernel headers.
 
/npat

-- 
Talking about music is like dancing about architecture
  -- Frank Zappa



More information about the Gcc-help mailing list