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]

mips-elf with newlib


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.


-- Michael N. Moran (h) 770 516 7918 5009 Old Field Ct. (c) 678 521 5460 Kennesaw, GA, USA 30144 http://mnmoran.org

"So often times it happens, that we live our lives in chains
    and we never even know we have the key."
The Eagles, "Already Gone"

The Beatles were wrong: 1 & 1 & 1 is 1






-- 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]