Trying to set up gcc 3.2.3 cross i686-linux -> mips-sgi-irix6

Alexander JOLK alexj@buf.com
Fri May 9 16:11:00 GMT 2003


Hi,

Kai, thanks a lot for your helpful input.  I've made some progress, but
I'm not quite there yet.  (BTW I'm now trying to compile the
gcc-3.3-20030508 snapshot.)

>> 2. Can someone enlighten me how I'm supposed to use --with-sysroot? 
>   It shouldn't work in gcc-3.2.3.

I had been under the erroneous impression that gcc needed to
`fixinclude' *all* the headers from sys-include (or sys-root/include) to
its own include directory.  Fixed in my head, and does indeed work.

>> Neither Irix' libc.a nor libc.so seem to be sufficient for
>> the build;
>> one of them is needed for the first part, the other for the second.

> Generally on MIPS/SVR4 systems like the Irixes, the
> usability of the '.a' libraries is unclear -- only the '.so' files
> should be used and everything should be in PIC-code. So I cannot
> understand why any '.a' files were tried as you claim...

I didn't look quite closely enough at the error messages.  You are right
in that only libc.so is needed and not libc.a; I had overlooked that ld
couldn't read symbols from an n32 libc.so for the *n64* libgcc. Once I
set up things properly for both ABIs, that started to work.

> 1.  Build GCC first using the 'make all-gcc'
> 
> 2.  Then install GCC using the 'make install-gcc'
> 
> 3.  Then try compiling and linking a "Hello World":
> 
>        mips-sgi-irix6-gcc -o hello hello.c
> 
>      If this doesn't work, try adding the '-v' and '-Wl,-verbose'
>      options to the command line and try to solve the problems...
>      There will be many, I think...

I did those steps, and making gcc alone does indeed work, and the
resulting binary runs with no problem on Irix 6.5.  Success, if you want
to call it that!  Now for the rest...

>   Or you can manually edit the 'specs'-file for the new cross-GCC and
> fix the search paths to follow the cross-GCC conventions.

That's what I did for the moment; once I've found a working config, I'd
pretty much like to get some hand-holding for editing the right file in
the sources dir so that it gets correctly installed.

>   There are bugs in gcc-3.2.3 sources and the right C++ headers will
> not be symlinked, the Irix6 is not alone, Solaris2 target builders
> must fix the same things... And all SVR3/4-targets etc. will fail
> in the libstdc++-v3 configure too...

Same thing here; I could use some pointers as to *where* in the build
process these links get made, and where I need to tweak in order to get
it right.  For the moment, continuing with handmade links...

>   Whatever headers are #included before the 'cxxabi.h' or in its
> beginning, they have some clashing weird definition for the
> '__result', or at least I would assume the error coming from this...

I investigated along these lines, and it is in
$PREFIX/mips-sgi-irix6/include/internal/sgimacros.h :

#ifdef __c99
#  define __restrict restrict
#else
#  define __restrict
#endif /* __c99 */

Commenting out that complete block helped it to proceed; now where does
this definition come from?  As far as I understand things, this might
need to be added to fixincludes?

Anyway I got a littler further now, tweaking things along the way. 
Right now I'm stuck with the following problem:
in mips-sgi-irix6/mabi=64/libstdc++-v3/src, 

/bin/sh ../libtool --tag CXX --mode=link
/work/gcc-32-cross/gcc-build/gcc/xgcc [...] -o libstdc++.la [...]

gets expanded to

/work/gcc-32-cross/gcc-build/gcc/xgcc -shared-libgcc [...] -soname
libstdc++.so.6 `test -n "sgi6.3:sgi6.2:sgi6.1:sgi6.0:sgi6.4" && echo
-set_version sgi6.3:sgi6.2:sgi6.1:sgi6.0:sgi6.4` -o
.libs/libstdc++.so.6.4

and bombs with

xgcc: libstdc++.so.6: No such file or directory
xgcc: sgi6.3:sgi6.2:sgi6.1:sgi6.0:sgi6.4: No such file or directory
xgcc: unrecognized option `-soname'
xgcc: unrecognized option `-set_version'
make: *** [libstdc++.la] Error 1

Huh?  My mips-sgi-irix6-ld says it can do `-soname', but chokes on
`-set_version'.  Where has it gone awry now?

As before, all help appreciated as well as pointers to relevant docs.

Alex

-- 
Alexander Jolk         /         BUF Compagnie
tel +33-1 42 68 18 28 /  fax +33-1 42 68 18 29

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



More information about the crossgcc mailing list