Subject: Building native binutils/gcc/glibc

From: Alex Gonzalez <[email-masked]>
Date: Mon, 18 Apr 2005 18:03:26 +0100

Hi,

I have a cross compilation toolchain that successfully builds a linux
2.6.11 kernel (o32) for my mips target, and elf executables to run on
it.

I am trying to cross compile native binutils/gcc and glibc to be able to
build on the target, using:

binutils 2.14
gcc 3.3.5
glibc 2.3.5

I configure them with --host=mips-linux-gnu --build=i686-pc-linux-glibc2.2 and target=mips-linux-gnu

After installing them in the target root filesystem, I try to compile a simple "Hello World" program, and I get the following error:

 Reading specs from /bin/../lib/gcc-lib/mips-linux-gnu/3.3.5/specs
Configured with: ../gcc-3.3.5/configure --host=mips-linux-gnu --target=mips-linux-gnu --build=i686-pc-linux-gnulibc2.2 --prefix=/home/alex/nfsroot/pv-rootfs --enable-clocale=gnu --enable-languages=c,c++
Thread model: posix
gcc driver version 3.3.5 executing gcc version 3.3-mips64linux-031001
 /bin/../lib/gcc-lib/mips-linux-gnu/3.3.5/cc1 -quiet -v -I /usr/include -iprefix /bin/../lib/gcc-lib/mips-linux-gnu/3.3.5/ -isystem /usr/lib/include -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 hello.c -quiet -dumpbase hello.c -auxbase hello -version -o ./ccKgGMsl.s
ignoring nonexistent directory "/usr/lib/include"
GNU C version 3.3.5 (mips-linux-gnu)
        compiled by GNU C version 3.3-mips64linux-031001.
GGC heuristics: --param ggc-min-expand=47 --param ggc-min-heapsize=32046
ignoring nonexistent directory "/mips-linux-gnu/include"
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/home/alex/nfsroot/pv-rootfs/include"
ignoring nonexistent directory "/home/alex/nfsroot/pv-rootfs/lib/gcc-lib/mips-linux-gnu/3.3.5/include"
ignoring nonexistent directory "/home/alex/nfsroot/pv-rootfs/mips-linux-gnu/include"
ignoring duplicate directory "/usr/include"
  as it is a non-system directory that duplicates a system directory
#include "..." search starts here:
#include <...> search starts here:
 /lib/gcc-lib/mips-linux-gnu/3.3.5/include
 /usr/include
End of search list.
 /bin/../lib/gcc-lib/mips-linux-gnu/3.3.5/../../../../mips-linux-gnu/bin/as -EB -g0 -32 -v -KPIC -o ./ccYlX6Ij.o ./ccKgGMsl.s
GNU assembler version 2.14 (mips-linux-gnu) using BFD version 2.14 20030612
 /bin/../lib/gcc-lib/mips-linux-gnu/3.3.5/collect2 --eh-frame-hdr -EB -dynamic-linker /lib/ld.so.1 /usr/lib/crt1.o /usr/lib/crti.o /bin/../lib/gcc-lib/mips-linux-gnu/3.3.5/crtbegin.o -L/bin/../lib/gcc-lib/mips-linux-gnu/3.3.5 -L/bin/../lib/gcc-lib -L/bin/../lib/gcc-lib/mips-linux-gnu/3.3.5/../../../../mips-linux-gnu/lib ./ccYlX6Ij.o -lgcc -lgcc_eh -rpath-link /lib:/usr/lib -lc -lgcc -lgcc_eh /bin/../lib/gcc-lib/mips-linux-gnu/3.3.5/crtend.o /usr/lib/crtn.o
/bin/../lib/gcc-lib/mips-linux-gnu/3.3.5/../../../../mips-linux-gnu/bin/ld: ./ccYlX6Ij.o: linking abicalls files with non-abicalls files
Bad value: failed to merge target specific data of file ./ccYlX6Ij.o
collect2: ld returned 1 exit status

Passing -a to gas, I see the .abicalls in the object file. Trying to compile with -mno-abicalls removes the .abicall from the object file but does not remove the error.

I have tried different versions of binutils/gcc/glibc, but I don't know if the problem comes from glibc, gcc or gas.

Does anybody have any clue about what's going on?

I enclose the output of,

gcc hello.c -I /usr/include -B /usr/lib -Wl,-t,-M -Wa,-a -mno-abicalls

in case it helps. 

Thanks a lot,
Alex

---

From: "Maciej W. Rozycki" <[email-masked]>
Date: Tue, 19 Apr 2005 12:16:06 +0100 (BST)

> build on the target, using:
[...]
> collect2: ld returned 1 exit status

 Update binutils.

  Maciej

---

From: Alex Gonzalez <[email-masked]>
Date: Tue, 19 Apr 2005 17:50:47 +0100

Thanks a lot, binutils-2.15 worked.
Alex