Subject: pkg/8669: qt programs using pkglibtool don't work (linker/loader bug?)
To: None <>
From: None <>
List: netbsd-bugs
Date: 10/23/1999 09:51:05
>Number:         8669
>Category:       pkg
>Synopsis:       programs compiled using pkglibtool against qt (or apparently any pkg C++ library) fail with 'Undefined symbol ""'
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager (NetBSD software packages system bug manager)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 23 09:00:01 1999
>Originator:     David Barr
>Release:        -current
System: NetBSD hokey 1.4K NetBSD 1.4K (HOKEY) #0: Mon Oct 4 11:25:13 EDT 1999 root@hokey:/usr/src/sys/arch/sparc/compile/HOKEY sparc

	This was reported on current-users.

: hokey:~;which musicbox
: hokey:~;musicbox
/usr/X11R6/lib/ Undefined symbol "" (reloc type = 12, symnum = 4)
: hokey:~;ldd /usr/pkg/bin/musicbox
         -lstdc++.2 => /usr/lib/
         -lm.0 => /usr/lib/
         -lc.12 => /usr/lib/
         -lqt.1 => /usr/X11R6/lib/
         -lX11.6 => /usr/X11R6/lib/
         -lXext.6 => /usr/X11R6/lib/
         -lossaudio.0 => /usr/lib/

Paul Kranenburg ( followed up with:
This error seems to pop up with every shared library built from C++
sources by using the `libtool' to construct the link command to
build the library from (PIC) object files.  The generated link command
includes `-lgcc' -- which is a static (non-PIC) library -- that
should preferably not be mixed in with the PIC object files of
the shared library being built.

A solution would be to have libtool use a similar recipe for building
shared libraries as do our native `make' rules, i.e. calling ld(1)
directly with appropriate options.

Unfortunately, reading through the logic of `libtool' feels about the
same as trying to retrieve one's lost contact lenses from a pile of
horse manure..

	Compile, install, run any qt app.  (in my case I tried musicbox)
	It will fail with:
/usr/X11R6/lib/ Undefined symbol "" (reloc type = 12, symnum = 4)

This seems to me to point to a linker/loader bug, involving the mixing
of PIC and non-PIC code.  Or, as pk says it's simply a bug in pkglibtool
which should use ld(1) instead of g++ to do the linking.