This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


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

Re: gcc cross-compiler for mips


On 24 Oct 1999 09:54:50 +0100, Michael Engel
<engel@math.uni-siegen.de> wrote:

>In comp.sys.mips Gookwon E. Suh <suh@mit.edu> wrote:
>
>: I'm trying to make a cross-compiler targeting for MIPS in Pentium PC
>: with Linux operating system. I'v downloaded gcc 2.95.1. and tried
>: compile after configure.
>: configure --target=mips-elf --prefix=/home/suh/prj/mips
>: make

 The current 'fixes' to GCC seem to have made the embedded 'mips-elf'
port to be seriously broken in gcc-2.95.1... But before noticing this,
first there are other problems coming from the long history of the
MIPS-processor with opsys'es like Irix3, Irix4 and Irix5, Sinix, etc.
for it, all using the native MIPS-tools...

 There are some silly assumptions like one having the native
MIPS-assembler (the mips-tfile is needed for it...).  So if a
embedded-toolset-builder expects the configure etc. to automatically
know, that using the GNU binutils is the only possibility, he/she will
get into problems. It isn't so easy, one must unfortunately tell the
fact to 'configure' using the '--with-gnu-as', so that it knows that
the GNU as will be used and the 'mips-tfile' utility will not be
needed...

 So, using the '--with-gnu-as', one gets easily the GCC-part built in
gcc-2.95.1, but just as one person recently wrote,  the resulted
'mips-elf' compiler doesn't really work... :

"After encountering a problem with no being able to find the
mips-tfile, I changed the make command to make all --with-gnu-as
--with-gnu-ld, and it ahead with no complaints. But while trying to
make libgcc2 it did not find quite a few include files like stdlib.h,
unistd.h, _ansi.h. These seem to be in newlib, which is not yet built.
I went ahead a make soft links to the build directory so that the
build would complete. It did make libgcc2 but later while compiling
tmp-dump.c the xgcc just built core dumped."

 I built my 'mips-elf' target compiler in last August, and cannot
remember what happened, but anyway I was obliged to fix the config
files... And I forgot to test the C++ part totally...

 If one checks how the current 'mips-linux' port works in the
gcc-2.95.1 sources and imitates the things from it, (Please see:
'gcc/config/mips/linux.h'), one can get a compiler which SEEMS to work
ok with C, but the C++-part of it is still broken... All my 'mips-elf'
programs, compiled from C++ sources will give the following error with
the simulator in GDB :

E:\usr\local\samples\cpluspls\chap20>run-mips-elf-i tst_mips-elf.x
mips-core: 4 byte read to unmapped address 0x34 at 0x0
program stopped with signal 10.

 Meanwhile the 'mips-ecoff' target works just fine (with the same BC++
code sample)...

E:\usr\local\samples\cpluspls\chap20>run-mips-ecoff-i tst_mips-ecoff.x
I like Borland C++.
You can use printf(), but most C++ programs don't.
Enter a number: 7
Your number is 7
Enter a string: Babylon5
Babylon5

 So the 'mips-elf' target will need a thorough check now...

>: Is there any other cross compiler available?
>
>Simply use the prebuilt cross-compiler and binutils RPMs from 
>ftp://oss.sgi.com/pub/linux/mips/crossdev/i386-linux/
>
>You can get versions for big- (mips-linux) and little-endian
>(mipsel-linux) MIPS CPUs.

 Excuse me, but the target 'mips-elf' doesn't automatically mean the
'mips-linux', just as the 'i386-elf' doesn't mean automatically the
'i386-linux'... But if one thinks the Linux/MIPS (or the SVR4/MIPS) to
be quite near the 'mips-elf', that's really a very good idea just
now...

 The mips-svr4-systems were the first to define the ELF-based
MIPS-ABI. Please see :

  www.sco.com/developer/devspecs

for the SVR4-ABI-docs and the MIPS RISC Processor Supplement.

 So some people could think the mips-linux being just a 'cheap
imitation', not the original one... Although the current news can say
that Unix is a commercial derivation from Linux, only fools can
believe these kind of 'jokes' ;-)

 The SVR4-PDF-docs may be good references for the ELF-format and the
Supplement for the MIPS-variation of it... And maybe now the ABI-docs
are really needed, expecting someone else to fix the 'mips-elf' may be
vain... I'll look at the C++-problems, but cannot promise anything...

 I haven't checked the current egcs-snapshots, perhaps these problems
are already fixed in them... Trying the snapshots and seeing the
situation doesn't hurt much.... (http://sourceware.cygnus.com/egcs)

Cheers, Kai


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