building gcc for mipsel

Kai Ruottu kai.ruottu@wippies.com
Mon Aug 22 16:25:00 GMT 2016


22.8.2016, 18:38, Kai Ruottu kirjoitti:
> About your problem elsewhere :
>
> > mipsel-openwrt-linux-musl-gcc -g -Os -O2 -g -Os -DIN_GCC -W -Wall 
> -Wno-narrowing
> > -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes 
> -Wold-style-definition
> > -isystem ./include -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc 
> -fno-stack-protector
> > -fPIC -I. -I. -I../../host-mipsel-openwrt-linux-musl/gcc 
> -I../.././libgcc
> > -I../.././libgcc/. -I../.././libgcc/../gcc 
> -I../.././libgcc/../include -DHAVE_CC_TLS
> > -o _m16addsf3_s.o -MT _m16addsf3_s.o -MD -MP -MF _m16addsf3_s.dep 
> -DSHARED -DL_m16addsf3
> > -xassembler-with-cpp -c ../.././libgcc/config/mips/mips16.S
>
> The use of stuff for 'mips16' could come from the '-elf' choice, Linux 
> not using these 16-bit opcodes
> at all...
>

Seemingly I was wrong...  I checked from my 'mips64el-linux-gnu' 
targeted crosstoolchain (gcc-4.8.3)
and its libgcc had these objects being produced. But of course produced 
with the just built GCC, not
with some earlier made GCC (your ' mipsel-openwrt-linux-musl-gcc'). The 
object format in the default
libraries were like this :

File: libgcc.a(_satfractunsUTIUTA.o)
ELF Header:
   Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
   Class:                             ELF32
   Data:                              2's complement, little endian
   Version:                           1 (current)
   OS/ABI:                            UNIX - System V
   ABI Version:                       0
   Type:                              REL (Relocatable file)
   Machine:                           MIPS R3000
   Version:                           0x1
   Entry point address:               0x0
   Start of program headers:          0 (bytes into file)
   Start of section headers:          2088 (bytes into file)
   Flags:                             0x20000027, noreorder, pic, cpic, 
abi2, mips3
   Size of this header:               52 (bytes)
   Size of program headers:           0 (bytes)
   Number of program headers:         0
   Size of section headers:           40 (bytes)
   Number of section headers:         25
   Section header string table index: 22

The copied glibc was probably an old Debian one (this inside the 
'lib/libc.so.6') :

GNU C Library stable release version 2.7, by Roland McGrath et al.
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.3.2.
Compiled on a Linux >>2.6.32-5-sb1-bcm91250a<< system on 2011-01-08.

Also in my gcc-5.1.0 based toolchain these things were in the same way, 
the glibc
from Debian was only changed to glibc-2.13...

[root@localhost 5.1.0]# mips64el-linux-gnu-gcc-5.1 -v
Using built-in specs.
COLLECT_GCC=mips64el-linux-gnu-gcc-5.1
COLLECT_LTO_WRAPPER=/opt/cross/lib/gcc/mips64el-linux-gnu/5.1.0/lto-wrapper
Target: mips64el-linux-gnu
Configured with: ../configure --build=i686-linux-gnu 
--host=i686-linux-gnu --target=mips64el-linux-gnu --prefix=/opt/cross 
--with-sysroot=/opt/host-mipsel-debian7.4.0-linux 
--libexecdir=/opt/cross/lib --enable-languages=c,c++,fortran 
--enable-targets=all --enable-shared --enable-threads=posix 
--enable-linker-build-id --enable-checking=release 
--enable-libstdcxx-debug --enable-clocale=gnu --disable-nls 
--without-included-gettext --enable-version-specific-runtime-libs 
--disable-libssp --disable-libgomp 
--with-gxx-include-dir=/opt/cross/include/c++/5.1.0 
--program-prefix=mips64el-linux-gnu- --program-suffix=-5.1
Thread model: posix
gcc version 5.1.0 (GCC)



More information about the Gcc-help mailing list