NetBSD-Bugs archive

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

toolchain/47955: toolchain issues with glib2



>Number:         47955
>Category:       toolchain
>Synopsis:       toolchain issues with glib2
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jun 23 05:45:00 +0000 2013
>Originator:     Michael van Elst
>Release:        NetBSD 6.99.19
>Organization:
        
>Environment:
        
        
System: NetBSD twitty 6.99.19 NetBSD 6.99.19 (TWITTY) #1: Wed May 22 19:52:07 
CEST 2013 
mlelstv@pussyfoot:/home/netbsd-current/obj.evbarm/home/netbsd-current/src/sys/arch/evbarm/compile/TWITTY
 evbarm
Architecture: earm
Machine: evbarm
>Description:
Trying to build the package devel/glib2 on an evbarm EABI system
results in the following error:

|   ld --eh-frame-hdr -X -m armelf_nbsd_eabi -dc -dp -e __start -dynamic-linker 
/usr/libexec/ld.elf_so -o .libs/gobject-query /usr/lib/crt0.o /usr/lib/crti.o 
/usr/lib/crtbegin.o 
-L/usr/pkgwrk/devel/glib2/work.twitty/glib-2.36.3/gobject/.libs 
-L/usr/pkgwrk/devel/glib2/work.twitty/glib-2.36.3/glib/.libs 
-L/usr/pkgwrk/devel/glib2/work.twitty/.buildlink/lib -v -R/usr/pkg/lib 
gobject-query.o -rpath /usr/pkg/lib -lgobject-2.0 -lffi -lglib-2.0 -lpcre 
-lintl -lgcc -lpthread -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o
|  GNU ld (NetBSD Binutils nb1) 2.21.1
|  /usr/pkgwrk/devel/glib2/work.twitty/.buildlink/lib/libffi.so: undefined 
reference to `__aeabi_unwind_cpp_pr1'

This is caused by libgcc.a not providing the unwind functions. Those are
only in libgcc_eh.a, but the compiler doesn't select it for linking.


The compiler (gcc4.5.4) doesn't select it for linking, because that's
not defined in the spec file. If you look at 'gcc -dumpsepcs' output
you only find:

*libgcc:
-lgcc


The more interesting part however is, that the specs for x86_64 show
the same:

*libgcc:
-lgcc

but somehow building glib2 does not fail for x86_64. The reason probably
is that the unwind functions for x86_64 exist in libgcc and libgcc_eh.

pussyfoot: {47} uname -a
NetBSD pussyfoot 6.99.19 NetBSD 6.99.19 (PUSSYFOOT) #1: Wed May  1 10:30:36 
CEST 2013  
mlelstv@pussyfoot:/home/netbsd-current/obj.amd64/home/netbsd-current/src/sys/arch/amd64/compile/PUSSYFOOT
 amd64
pussyfoot: {44} nm /usr/lib/libgcc.a | grep Unwind_Backtrace
00000000000022ae T _Unwind_Backtrace
pussyfoot: {45} nm /usr/lib/libgcc_eh.a | grep Unwind_Backtrace
00000000000022ae T _Unwind_Backtrace


Looking at an older arch/amiga system with gcc4.1.3 you find that
libgcc and libgcc_eh are different, only libgcc_eh provides the
unwind functions.

serpens% uname -a
NetBSD serpens.de 5.0_STABLE NetBSD 5.0_STABLE (SERPENS) #0: Sun Nov  1 
23:35:16 CET 2009  
spz@aquila:/home/netbsd/src5/src/sys/arch/amiga/compile/obj/SERPENS amiga
serpens% nm /usr/lib/libgcc.a | grep -i Unwind_Backtrace
serpens% nm /usr/lib/libgcc_eh.a | grep -i Unwind_Backtrace
00001644 T _Unwind_Backtrace

But here the specs tell the compiler what to do:

*libgcc:
%{static: -lgcc -lgcc_eh}%{static-libgcc: %{!shared:-lgcc -lgcc_eh}%{shared:-lgc
c_pic -lgcc_eh_pic}}%{!static:%{!static-libgcc:%{!shared:%{!shared-libgcc:-lgcc 
-lgcc_eh}%{shared-libgcc:-lgcc_s -lgcc}}%{shared:%{shared-libgcc:-lgcc_s} -lgcc_
pic}}}


It could be that gcc4.5.4 dropped the spec-file mechanics and requires
libgcc to include the unwind functions, then we build or libgcc wrong
for some archs.

Or what I find more likely is, that we build bad specs and libgcc
on x86_64 is built wrong to compensate.




>How-To-Repeat:
Try to build devel/glib2 on an evbarm EABI system.
>Fix:
        

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index