Subject: pkgsrc/Solaris: vsftpd linking errors (with solution)
To: None <>
From: Mehul Sanghvi <>
List: pkgsrc-users
Date: 08/14/2007 10:09:53
When building vsftpd I get the following linker error:

gcc -c readwrite.c -O -DPKG_SYSCONFDIR="\"/usr/pkg/etc/vsftpd\""
-I/usr/include -I/usr/pkg/include -idirafter dummyinc
gcc -c ssl.c -O -DPKG_SYSCONFDIR="\"/usr/pkg/etc/vsftpd\""
-I/usr/include -I/usr/pkg/include -idirafter dummyinc
gcc -c sysutil.c -O -DPKG_SYSCONFDIR="\"/usr/pkg/etc/vsftpd\""
-I/usr/include -I/usr/pkg/include -idirafter dummyinc
gcc -c sysdeputil.c -O -DPKG_SYSCONFDIR="\"/usr/pkg/etc/vsftpd\""
-I/usr/include -I/usr/pkg/include -idirafter dummyinc
sysdeputil.c: In function `vsf_sysdep_check_auth':
sysdeputil.c:290: warning: initialization from incompatible pointer type
gcc -o vsftpd main.o utility.o prelogin.o ftpcmdio.o postlogin.o
privsock.o  tunables.o ftpdataio.o secbuf.o ls.o  postprivparent.o
logging.o str.o netstr.o sysstr.o strlist.o  banner.o filestr.o
parseconf.o secutil.o  ascii.o oneprocess.o twoprocess.o privops.o
standalone.o hash.o  tcpwrap.o ipaddrparse.o access.o features.o
readwrite.o  ssl.o sysutil.o sysdeputil.o  -L/usr -Wl,-R/usr -lpam
-L/usr/pkg -Wl,-R/usr/pkg -lssl -lcrypto -L/usr/pkg -Wl,-R/usr/pkg
-lwrap -lsocket -lnsl -lrt -lsendfile -L/usr/lib -Wl,-R/usr/lib
-L/usr/pkg/lib -Wl,-R/usr/pkg/lib -lnsl -lsocket
Undefined                       first referenced
 symbol                             in file
inet_aton                           sysutil.o
ld: fatal: Symbol referencing errors. No output written to vsftpd
collect2: ld returned 1 exit status
*** Error code 1

bmake: stopped in /usr/pkgsrc/net/vsftpd/work/vsftpd-2.0.4

I looked through all the lib*.so files in /usr/lib and found inet_aton
net/vsftpd/Makefile needed to be modified so that

     LIBS.SunOS=  -lsocket -lnsl -lrt -lsendfile


     LIBS.SunOS= -lresolv -lsocket -lnsl -lrt -lsendfile

and then everything works.

How do I go about getting this updated in CVS ?

Mehul N. Sanghvi