Issue to build cross-gcc for MIPS big endian target (bu2.14.90.0. 7, gcc3.3.2, glibc2.2.5)

Roman Duka rduka@mail.ru
Tue Dec 16 12:57:00 GMT 2003


David Mentre wrote:
> Hello,
> 
> I'm trying to build a cross-gcc for a MIPS big endian target (usual x86
> host).
> 
> Right now, I'm using :
>  binutils 2.14.90.0.7
>  gcc 3.3.2
>  glibc 2.2.5
> 
> I'm using crosstool-0.25 from Dan Kegel with following configuration files:
> 
> [David@DAHUT crosstool-0.25]$ cat mips.dat
> TARGET=mips-unknown-linux-gnu
> TARGET_CFLAGS="-O2 -finline-limit=10000"
> 
> [David@DAHUT crosstool-0.25]$ cat gcc-3.3.2-glibc-2.2.5.dat
> BINUTILS_DIR=binutils-2.14.90.0.7
> GCC_DIR=gcc-3.3.2
> GLIBC_DIR=glibc-2.2.5
> LINUX_DIR=linux-2.4.19-rc1-cpp-mitsu
> GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.2.5
> BUILD_DIR=/usr/local/src/mips-toolchain
> PREFIX=/usr/Applications/tc-mips-linux-bu2.14.90.0.7-gcc3.3.2-glibc2.2.5
> TARBALLS_DIR=/usr/local/src/tarballs
> 
> I am calling Dan's scripts with:
> eval `cat mips.dat` `cat gcc-3.3.2-glibc-2.2.5.dat` sh all.sh --notest
> 
> 
> I have already fixed a small issue by applying following patch to
> glibc-2.2.5/sysdeps/mips/dl-machine.h
> 
> --- dl-machine.h.orig   2003-12-16 11:05:03.000000000 +0100
> +++ dl-machine.h        2003-12-16 10:48:40.000000000 +0100
> @@ -450,7 +450,7 @@
>         addu $7, $7, 4\n\
>         subu $29, 16\n\
>         # Call the function to run the initializers.\n\
> -       jal _dl_init
> +       jal _dl_init\n\
>         addiu $29, 16\n\
>         # Pass our finalizer function to the user in $2 as per ELF ABI.\n\
>         la $2, _dl_fini\n\
> 
> 
> Everything (binutils, gcc first pass, glibc) seems to compile nicely.
> However, when the script is doing a make install for glibc, I obtain the
> following error:
> 
> + make install
> install_root=/usr/Applications/tc-mips-linux-bu2.14.90.0.7-gcc3.3.2-glibc2.2
> .5/mips-unknown-linux-gnu prefix=
> make: error while loading shared libraries: libc.so.6: ELF file data
> encoding not little-endian
> 
> 
> I do not understand the issue. Would it be related to /bin/ld.so called
> instead of target ld.so? Has anybody faced a similar issue? Any idea how to
> fix that?
> 
> Many thanks in advance for any help,
> Sincerely yours,
> david mentré

well i'm using binutils-2.14, gcc-3.3.2, glibc-2.3.2, 
glibc-linuxthreads-2.3.2, linux-2.4.20
and i had no problems building full glibc for mips target, maybe your 
version of glibc has some bugs in it?? have you tried using 
glibc-2.3.2?? though i am using a heavily modified version of Dan Kegel 
script, try using glibc-2.3.2 and if it fails, get back to me and i'll 
send you my cross tool scripts, if that's any help.

i've just compiled a test C programs and ran readelf on it, here is what 
i get:

roman@athlon1000:~/crosstool/mips-unknown/bin> ./*readelf -h a.out
ELF Header:
   Magic:   7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
   Class:                             ELF32
   Data:                              2's complement, big endian
   Version:                           1 (current)
   OS/ABI:                            UNIX - System V
   ABI Version:                       0
   Type:                              EXEC (Executable file)
   Machine:                           MIPS R3000
   Version:                           0x1
   Entry point address:               0x4005e0
   Start of program headers:          52 (bytes into file)
   Start of section headers:          5416 (bytes into file)
   Flags:                             0x1005, noreorder, cpic, o32, mips1
   Size of this header:               52 (bytes)
   Size of program headers:           32 (bytes)
   Number of program headers:         7
   Size of section headers:           40 (bytes)
   Number of section headers:         33
   Section header string table index: 30
roman@athlon1000:~/crosstool/mips-unknown/bin>

so the tool chain does produce big endian mips elf files


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