Subject: compiling libaudiofile on Solaris9 failed
To: None <tech-pkg@netbsd.org>
From: Kurt Schreiner <ks@ub.uni-mainz.de>
List: tech-pkg
Date: 03/19/2004 18:29:16
Hi,

fetched a fresh pkgsrc some hours ago and tried to compile xmms, which,
between others needs libaudiofile. System is a SunBlade 1000 running
Solaris 9, pkgsrc bootstrapped some week ago using the then current
othersrc/bootstap-pkgsrc.

The compilation fails with:

 gcc -v -shared -Wl,-M -Wl,.libs/libaudiofile.so.0.2.exp -Wl,-h
-Wl,libaudiofile.so.0 -o .libs/libaudiofile.so.0.2 .libs/openclose.o
.libs/setup.o .libs/format.o .libs/data.o .libs/pcm.o .libs/error.o
.libs/byteorder.o .libs/af_vfs.o .libs/util.o .libs/debug.o
.libs/aupv.o .libs/units.o .libs/compression.o .libs/aes.o
.libs/instrument.o .libs/loop.o .libs/marker.o .libs/misc.o
.libs/track.o .libs/query.o .libs/raw.o .libs/aiff.o .libs/aiffwrite.o
.libs/extended.o .libs/next.o .libs/nextwrite.o .libs/wave.o
.libs/wavewrite.o .libs/ircam.o .libs/ircamwrite.o .libs/avr.o
.libs/avrwrite.o .libs/iff.o .libs/iffwrite.o .libs/nist.o
.libs/nistwrite.o .libs/g711.o .libs/modules.o -z allextract
modules/.libs/libmodules.a -z defaultextract
-L/u/NetBSD/pkgobj/audio/libaudiofile/work/.buildlink/gcc3/lib/gcc-lib/sparc-sun-solaris2/3.3.3
-L/u/NetBSD/pkgobj/audio/libaudiofile/work/.buildlink/gcc3/lib
-L/u/NetBSD/pkgobj/audio/libaudiofile/work/.buildlink/lib -lm -lc
-Wl,-R/opt/nb/gcc3/lib/gcc-lib/sparc-sun-solaris2/3.3.3 Reading specs
from /opt/nb/gcc3/lib/gcc-lib/sparc-sun-solaris2/3.3.3/specs
Configured with: ./configure --prefix=/opt/nb/gcc3
--host=sparc-sun-solaris2 --enable-shared --enable-languages=c Thread
model: posix gcc version 3.3.3
/opt/nb/gcc3/lib/gcc-lib/sparc-sun-solaris2/3.3.3/collect2 -V -G -dy
-z text -Y P,/usr/ccs/lib:/usr/lib -Qy -o .libs/libaudiofile.so.0.2 -z
allextract /opt/nb/gcc3/lib/gcc-lib/sparc-sun-solaris2/3.3.3/crti.o
/usr/ccs/lib/values-Xa.o
/opt/nb/gcc3/lib/gcc-lib/sparc-sun-solaris2/3.3.3/crtbegin.o
-L/u/NetBSD/pkgobj/audio/libaudiofile/work/.buildlink/gcc3/lib/gcc-lib/sparc-sun-solaris2/3.3.3
-L/u/NetBSD/pkgobj/audio/libaudiofile/work/.buildlink/gcc3/lib
-L/u/NetBSD/pkgobj/audio/libaudiofile/work/.buildlink/lib
-L/opt/nb/gcc3/lib/gcc-lib/sparc-sun-solaris2/3.3.3 -L/usr/ccs/bin
-L/usr/ccs/lib
-L/opt/nb/gcc3/lib/gcc-lib/sparc-sun-solaris2/3.3.3/../../.. -R/opt/nb/gcc3/lib
-M .libs-L -laudiofileexp -h libaudiofile.so.0 .libs/openclose.o
.libs/setup.o .libs/format.o .libs/data.o .libs/pcm.o .libs/error.o
.libs/byteorder.o .libs/af_vfs.o .libs/util.o .libs/debug.o
.libs/aupv.o .libs/units.o .libs/compression.o .libs/aes.o
.libs/instrument.o .libs/loop.o .libs/marker.o .libs/misc.o
.libs/track.o .libs/query.o .libs/raw.o .libs/aiff.o .libs/aiffwrite.o
.libs/extended.o .libs/next.o .libs/nextwrite.o .libs/wave.o
.libs/wavewrite.o .libs/ircam.o .libs/ircamwrite.o .libs/avr.o
.libs/avrwrite.o .libs/iff.o .libs/iffwrite.o .libs/nist.o
.libs/nistwrite.o .libs/g711.o .libs/modules.o
modules/.libs/libmodules.a
-R/opt/nb/gcc3/lib/gcc-lib/sparc-sun-solaris2/3.3.3 -lm -lc -lgcc_s
-lgcc_s /opt/nb/gcc3/lib/gcc-lib/sparc-sun-solaris2/3.3.3/crtend.o
/opt/nb/gcc3/lib/gcc-lib/sparc-sun-solaris2/3.3.3/crtn.o ld: Software
Generation Utilities - Solaris Link Editors: 5.9-1.373 ld: fatal: file
.libs-L: stat failed: No such file or directory collect2: ld returned 1
exit status *** Error code 1

Ok, there _is_ not .libs-L which comes from:

>-699: egrep libs-L work/.buildlink/bin/.*
work/.buildlink/bin/.cache-add-trans:   cachearg="-Wl,.libs-L -laudiofileexp"
work/.buildlink/bin/.cache-trans:       cachearg="-Wl,.libs-L -laudiofileexp"

Now how does it come that "-Wl,.libs/libaudiofile.so.0.2.exp)"
translates to "cachearg="-Wl,.libs-L -laudiofileexp""???

There are other cases where "-Wl,.libs/<something>.so.?.?.exp" is
translated to -Wl,.libs-L -<something> so I think that's a general
fault (at least on Solaris) somewhere in the code that generates
.../cache-{add-,}trans. But's way over my head to locate the bugger ;-(

My be with the help of someone knowing more about the buildlink
framework I could try to find the bug? Would it be usefull to send-pr?
Or is it just me???

Any answers appreciated

-kurt

ps.: Here's my /etc/mk.conf, if it matters. {c++,f77}.mk are just as
     generated by bmake-ing gcc from pkgrc (using suns forte 5), with
     "-v" added to "CC=             /opt/nb/gcc3/bin/cc".

# Example /etc/mk.conf file produced by bootstrap-pkgsrc
# Mon Jan 13 16:27:49 MET 2003

###PKG_DEBUG_LEVEL=2

.include "/opt/nb/gcc3/mk/c++.mk"
.include "/opt/nb/gcc3/mk/f77.mk"

.ifdef BSD_PKG_MK       # begin pkgsrc settings

PKG_DBDIR=/opt/nb/var/db/pkg
LOCALBASE=/opt/nb
FETCH_CMD=/opt/nb/bin/ftp
PAX=/opt/nb/bin/pax
SED=/opt/nb/bin/nbsed

BSDXSRCDIR=             /u/NetBSD/xsrc/xfree
BSDSRCDIR=              /u/NetBSD/src
MKOBJDIRS=              YES
MKHOSTOBJ=              YES
WRKOBJDIR=              /u/NetBSD/pkgobj
USE_XF86_4=             YES
PAPAERSIZE=             A4
HAVE_MOTIF=             YES
INSTALL_RCD_SCRIPTS=    YES
#
#
SQUID_HTTP_PORT=        8080
SQUID_SYSCONFDIR=       /etc/squid
#
APACHE_SUEXEC=          YES
#

.endif                  # end pkgsrc settings