Subject: pkg/37260: glib-2.14.2 fails to build on IRIX
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <srcshelton@gmail.com>
List: pkgsrc-bugs
Date: 11/01/2007 19:35:00
>Number:         37260
>Category:       pkg
>Synopsis:       glib-2.14.2 fails to build on IRIX
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 01 19:35:00 +0000 2007
>Originator:     Stuart Shelton
>Release:        n/a - current from CVS
>Organization:
>Environment:
IRIX64 octane 6.5 07202013 IP30 - IRIX 6.5.30, MIPSpro Compilers 7.4.4m
>Description:

The latest glib2 package fails during linking on IRIX:

/bin/ksh ../libtool --mode=link cc  -c99 -O2 -n32 -mips4 -r14000 -apo -float_const -use_readonly_const -TARG:isa=mips4:platform=ip30:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -woff 1174,1183,1185,1552,3970,3968 -n32 -I/usr/bsd/include -I/usr/include  -Wl,-v,-s,-x,-n32,-mips4,-rdata_shared,-allow_jump_at_eop,-rpath,/usr/bsd/lib -n32 -L/usr/bsd/lib32 -Wl,-rpath,/usr/bsd/lib32 -L/usr/lib32 -Wl,-rpath,/usr/lib32 -Wl,-rpath,/usr/bsd/lib -o errorcheck-mutex-test  errorcheck-mutex-test.o ../glib/libglib-2.0.la ../gthread/libgthread-2.0.la   -lintl  
cc -c99 -O2 -n32 -mips4 -r14000 -apo -float_const -use_readonly_const -TARG:isa=mips4:platform=ip30:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -woff 1174,1183,1185,1552,3970,3968 -n32 -I/usr/bsd/var/tmp/devel/glib2/work/.buildlink/include -Wl,-v -Wl,-s -Wl,-x -Wl,-n32 -Wl,-mips4 -Wl,-rdata_shared -Wl,-allow_jump_at_eop -Wl,-rpath -Wl,/usr/bsd/lib -n32 -Wl,-rpath -Wl,/usr/bsd/lib32 -Wl,-rpath -Wl,/usr/lib32 -o .libs/errorcheck-mutex-test errorcheck-mutex-test.o  -L/usr/bsd/var/tmp/devel/glib2/work/glib-2.14.2/glib/.libs -L/usr/bsd/var/tmp/devel/glib2/work/.buildlink/lib32 ../glib/.libs/libglib-2.0.so -L/usr/bsd/var/tmp/devel/glib2/work/.buildlink/lib ../gthread/.libs/libgthread-2.0.so /usr/bsd/var/tmp/devel/glib2/work/glib-2.14.2/glib/.libs/libglib-2.0.so -lmp /usr/bsd/var/tmp/devel/glib2/work/.buildlink/lib/libintl.so /usr/bsd/var/tmp/devel/glib2/work/.buildlink/lib/lib
 iconv.so -lc  -Wl,-rpath -Wl,/usr/bsd/lib:/usr/bsd/var/tmp/devel/glib2/work/.buildlink/lib

...

ld32: ERROR   33 : Unresolved text symbol "g_thread_init_with_errorcheck_mutexes" -- 1st referenced by errorcheck-mutex-test.o.
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: .init.
ld32: .rodata.
ld32: .data.
ld32: .got.
ld32: .srdata.
ld32: .bss.
ld32: .debug_abbrev.
ld32: .debug_info.
ld32: .debug_frame.
ld32: .debug_aranges.
ld32: .comment.
ld32: .MIPS.interfaces.
ld32: .MIPS.events.text.
ld32: .MIPS.events.init.
ld32: .MIPS.content.data.
ld32: .shstrtab.
ld32: Sorting dynamic relocation records.
ld32: INFO    152: Output file removed because of error.
gmake[3]: *** [errorcheck-mutex-test] Error 2
gmake[3]: Leaving directory `/usr/bsd/var/tmp/devel/glib2/work/glib-2.14.2/tests'
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory `/usr/bsd/var/tmp/devel/glib2/work/glib-2.14.2/tests'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/usr/bsd/var/tmp/devel/glib2/work/glib-2.14.2'
gmake: *** [all] Error 2
*** Error code 2

Stop.
bmake: stopped in /usr/bsd/src/devel/glib2
*** Error code 1

Stop.
bmake: stopped in /usr/bsd/src/devel/glib2

>How-To-Repeat:

The problem may be because of the literal nature of IRIX' ld, which requires objects and libraries to be specified in the correct sequence...
>Fix:

I quick-and-dirty fix was to remove references to "tests" from two locations in the top-level Makefile in the work/glib-2.14.2/ directory:

from SUBDIRS at around line 255, and from $(mkinstalldirs) of the distdir target around line 639.

Without these, the package built and installed correctly - so I assume that nothing from /tests/ is the the PLIST.

Interestingly, "bmake test" in the top-level directory also succeeds - but potentially this is because the testing utilities weren't built.