Subject: buildlink problems
To: None <tech-pkg@netbsd.org>
From: Jonathan Perkin <sketch@rd.bbc.co.uk>
List: tech-pkg
Date: 11/13/2002 15:57:33
Hullo,

I've been having problems recently doing basic pkgsrc compiling, and I
think I've narrowed it down to buildlink, but not sure and someone who
knows this magic better than me will be able to work it out.

Building libtool-base, I get:

Making all in .
Making all in libltdl
/bin/ksh ./libtool --mode=link gcc  -O -I/home/jonp/pkg/include  -o libltdl.la -rpath /home/jonp/pkg/lib -no-undefined -version-info 3:0:0 ltdl.lo  
ld -G -z defs -h libltdl.so.3 -o .libs/libltdl.so.3.0  .libs/ltdl.o  -lc 
Undefined                       first referenced
 symbol                             in file
__ctype                             .libs/ltdl.o
malloc                              .libs/ltdl.o
[...]

so it's obviously having problems picking up /usr/lib/libc.so

Turning on PKG_DEBUG_LEVEL and copying the /usr/bin/env output into a
test script, I started removing various variables to see if that helped.
I found by removing the .buildlink/bin path from $PATH and all the BUIL*
variables that it compiles fine.

Original:

/usr/bin/env USETOOLS=no MAKECONF=/dev/null USETOOLS=no OBJECT_FMT=ELF LDFLAGS= PATH=/cache/pkgsrc/devel/libtool-base/work/.buildlink/bin:/home/jonp/epkg/bin:/home/jonp/pkg/sbin:/home/jonp/pkg/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/local/bin:/usr/local/bin.sun4:/usr/openwin/bin:/home/jonp/pkg/bin:/usr/X11R6/bin PREFIX=/home/jonp/pkg LOCALBASE=/home/jonp/pkg X11BASE=/usr/X11R6 CFLAGS="-O -I/home/jonp/pkg/include" CPPFLAGS=-I/home/jonp/pkg/include FFLAGS=-O X11PREFIX=/usr/X11R6 PKG_SYSCONFDIR=/home/jonp/pkg/etc BUILDLINK_DIR=/cache/pkgsrc/devel/libtool-base/work/.buildlink BUILDLINK_X11_DIR=/cache/pkgsrc/devel/libtool-base/work/.buildlink-x11 BUILDLINK_CPPFLAGS=-I/home/jonp/pkg/include BUILDLINK_LDFLAGS="-L/home/jonp/pkg/lib -Wl,-R/home/jonp/pkg/lib" CC=gcc CXX=g++ LD=ld bmake -f Makefile all

Working:

/usr/bin/env USETOOLS=no MAKECONF=/dev/null USETOOLS=no OBJECT_FMT=ELF LDFLAGS= PATH=/home/jonp/epkg/bin:/home/jonp/pkg/sbin:/home/jonp/pkg/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/local/bin:/usr/local/bin.sun4:/usr/openwin/bin:/home/jonp/pkg/bin:/usr/X11R6/bin PREFIX=/home/jonp/pkg LOCALBASE=/home/jonp/pkg X11BASE=/usr/X11R6 CFLAGS="-O -I/home/jonp/pkg/include" CPPFLAGS=-I/home/jonp/pkg/include FFLAGS=-O X11PREFIX=/usr/X11R6 PKG_SYSCONFDIR=/home/jonp/pkg/etc CC=gcc CXX=g++ LD=ld bmake -f Makefile all

I'm sure buildlink wouldn't remove standard library paths from the
linker, would it?  From what I can see it only adds to ${CFLAGS} anyway,
rather than replacing it.

This is Solaris 5.8 and latest pkgsrc and othersrc/bootstrap-pkgsrc.

Thanks for any hints.

-- 
Jonathan Perkin - Internet Operations Engineer - BBC Internet Services
24x7 Hotline: +44 (0)1628 407 777 (x37777) - http://support.bbc.co.uk/