NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-mips/49806: binaries linked with -static-libgcc crash on MIPS



>Number:         49806
>Category:       port-mips
>Synopsis:       binaries linked with -static-libgcc crash on MIPS
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-mips-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 01 09:55:00 +0000 2015
>Originator:     Michael Lorenz
>Release:        -current
>Organization:
>Environment:
NetBSD ci20 7.99.7 NetBSD 7.99.7 (CI20) #1: Sun Mar 29 05:19:00 EDT 2015  ml@blackbush:/home/build/obj_evbmips32/sys/arch/evbmips/compile/CI20 evbmips
NetBSD moonshine 7.99.5 NetBSD 7.99.5 (O2) #1: Fri Feb 27 08:50:00 EST 2015  ml@blackbush:/stuff/build/obj_sgimips/sys/arch/sgimips/compile/O2 sgimips

>Description:
Some tests in gcc's configure script fail like this:
cc -pipe -O2 -static-libstdc++ -static-libgcc -o test test.c
./test
Bus error (core dumped)
( specifically the one trying to figure out what size long longs are but I don't think this matters )
On sgimips the fault happens in rtld_start() from /usr/libexec/ld.elf_so with memory at the fault address inaccessible, on mips32 it looks somewhat different:
Program received signal SIGBUS, Bus error.
0x00400608 in ?? ()
(gdb) disassemble 0x004005f0, +100
Dump of assembler code from 0x4005f0 to 0x400654:
   0x004005f0:  0x5f5f0061
   0x004005f4:  0x5f737362
   0x004005f8:  0x72617473
   0x004005fc:  0x665f0074
   0x00400600:  0x737362
   0x00400604:  0x646e655f
=> 0x00400608:  bgtz    zero,0x400e0c
   0x0040060c <_init+4>:        0x9c88373c
   0x00400610 <_init+8>:        lwr     zero,8487(t7)
   0x00400614 <_init+12>:       cache   0x1f,-6141(t7)
   0x00400618 <_init+16>:       cache   0x0,5159(t8)
   0x0040061c <_init+20>:       0xb00000af
   0x00400620 <_init+24>:       lb      zero,8623(a0)
   0x00400624:  0xe02103
   0x00400628:  lwr     zero,11266(t4)
(gdb) disassemble 0x00400e0c, +100
Dump of assembler code from 0x400e0c to 0x400e70:
   0x00400e0c:  jal     0x107434
   0x00400e10:  ldc3    $0,0(s0)
   0x00400e14:  0xedf
   0x00400e18:  nop
   0x00400e1c:  sdc3    $31,-1(ra)

On both machines the binary works fine without -static-libgcc.
The same happens with binaries linked with -lexecinfo, which keeps things like cmake from building.
>How-To-Repeat:
build.sh tools or build pkgsrc/lang/cmake on evbmips-el or sgimips, likely other mips as well
>Fix:



Home | Main Index | Thread Index | Old Index