This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: mips-elf with newlib


Hi Michael,

You need to do the following steps.

1. make and install cross binutils (you are doing that alright)

2. Configure gcc with options you have and also add these --with-newlib --with-headers=[newlib-src]/newlib/libc/include

3. make a minimal gcc enough to build newlib (make all-gcc install-gcc)

4. Build and install newlib

5. Go back to your gcc build tree and now build and install complete gcc (make all install)

That should give you a functional toolchain with newlib.

HTH

Khem

Michael N. Moran said the following on 10/30/2006 8:28 AM:
Hi folks,

For the last couple of days, I have struggled in vain
to produce a "working" mips-elf toolchain with newlib.

Over the years I have managed to build GCC/binutil/newlib
toolchains for several targets including ARM, PowerPC,
68K, H8, AVR and their variants. However, I am now in
search of a big endian MIPS toolchain. No problem ...
right? ;-)

At this point I have tried various combinations of
binutils, GCC and newlib versions.

One constant that I have noticed is that I get errors
that look like this as the xgcc cross compiler
attempts to build libgcc and others:

/tmp/ccZrU2HW.s:5713: Warning: size (177) out of range, ignored

This warning comes from mips-elf-as as executed by GCC.
Apparently, it does not like the ".size" directives
produced by GCC?

The GCC build finally dies with the following error
while attempting to link libgcc.a :

mips-elf-ranlib: ./libgcc.a: Malformed archive
make[2]: *** [libgcc.a] Error 1

After some investigation it seems that the following
libgcc objects cause some object "code" to be produced
that results in the "Malformed archive".

_m16fix_truncdfsi.o
_m16fix_truncsfsi.o
_enable_execute_stack.o

Using "_enable_execute_stack.o" as an example (from libgcc2.c),
I can create and compile a C file with the "identical" function
and the result produced no warning or Malformed archive error.


I compare the actual "text" sections of these object files and they look identical, so I *assume* the difference lies in one of the other sections of the object file (e.g. debug info).

I must be doing something wrong, but exactly what alludes me.

*My binutils config looks like this:*

../binutils-2.17/configure \
      --target=mips-elf \
      --prefix=/tools/gnu/gcc/4.0.2/mips-elf

nice -n 19 make CFLAGS="-O2 -fomit-frame-pointer" 2>&1 | tee make.temp

*My GCC config looks like this:*

ln -s
    ../../../newlib/1.14.0/newlib-1.14.0/newlib ../gcc-4.0.2/newlib

BINUTILS_PATH=/tools/gnu/gcc/4.0.2/mips-elf/bin

export PATH=$PATH:$BINUTILS_PATH

../gcc-4.0.2/configure \
      --target=mips-elf \
      --prefix=/tools/gnu/gcc/4.0.2/mips-elf \
      --with-newlib \
      --disable-newlib-supplied-syscalls \
      --enable-languages=c,c++

nice -n 19 make CFLAGS="-O2 -fomit-frame-pointer" 2>&1 | tee make.temp

Any clues appreciated.



-- Khem Raj <kraj@mvista.com> MontaVista Software Inc.


-- For unsubscribe information see http://sourceware.org/lists.html#faq


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