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


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

Re: problems with EGCS


> I'm trying to compile a i686-pc-linux-gnu crosscompiler on a Sparc SunOS5.7 
> machine.  I've gotten as far as installing the most recent version of 
> binutils from debian.org and compiling almost the entire EGCS distribution 
> via "make cross", but the compilation dies when it tries to make 
> libiberty after making the new gcc.  
> 
> gmake[2]: Entering directory `/usr/ucc/src/working/cross-compiler/build-linux-egcs/i686-pc-linux-gnu/libiberty'
> test x"yes" != xyes || \
>   /usr/ucc/src/working/cross-compiler/build-linux-egcs/gcc/xgcc
> -B/usr/ucc/src/working/cross-compiler/build-linux-egcs/gcc/ -c -DHAVE_CONFIG_H 
> -g -O2 -I. -I../../../egcs-1.1.1/libiberty/../include  -> 
> ../../../egcs-1.1.1/libiberty/choose-temp.c:40: sys/types.h: No such file or directory
> ../../../egcs-1.1.1/libiberty/choose-temp.c:41: sys/file.h: No such file or directory
> ../../../egcs-1.1.1/libiberty/choose-temp.c:50: stdio.h: No such file or directory
> 
> I have glibc-2.01 kicking around but I thought that I needed it, as well as 
> some genuine Linux kernel include files, later.

 When compiling libs for the target (Linux here), like 'libiberty.a', 
'libstdc++.a' and 'libg2c.a', you will need the proper headers and libs for the 
target installed to your build/host machine. In the Linux case there should be 
no problems, like legal aspects, to get them.

 If you didn't use the '--prefix', the default install places for them are :
    /usr/local/i686-pc-linux-gnu/include
and
    /usr/local/i686-pc-linux-gnu/lib

 Besides the libs and headers for Linux, you will also need to copy the dynamic 
linker, '/lib/ld-linux.so.2', to the host. Just copy it to the same directory 
as the Linux libs and use the '-rpath=/usr/local/i686-pc-linux-gnu/lib' in the 
link spec (in the specs file, in the line after '*link:') :

  *link:
  -m elf_i386 %{shared:-shared} %{!shared: %{!ibcs: %{!static: 
  %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker ld-linux.so.2 
  --rpath /usr/local/i686-pc-linux-gnu/lib}} %{static:-static}}}

> I configured egcs with "--with-newlib" to define the inhibit_libc symbol so 
> that libgcc.a could be compiled.  

 Newlib doesn't support Linux and its I/O (streams etc.) differs from the glibc
ones, so you cannot substitute the Linux headers with newlib headers. So you
have better to rebuild 'libgcc.a' too using the Linux headers.

 Cheers, Kai
_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.