Subject: Compiling with -static......

From: "Simon Convey" <[email-masked]>
Date: Tue, 24 Mar 1998 09:19:04 +0100

Dear wu users,
    I've finally finished my modifications to wu-ftpd to authenticate
via authsrv, ( thanks to 'a kind frenchman' , I left his mail on another
machine..Ooops. for sending some Authsrv diffs ) and do some 'other
interesting things.....' Now I need to compile static so that I have
much less hassle in running chroot. ( All the accounts, guest or
otherwise get chrooted to their respective directories, even after inet
chroot the ftpd to a secure area in the first place ! )
    O.K. If I compile using -static, I get symbols not found namely.....

Undefined                       first referenced
 symbol                             in file
dlclose                             /usr/lib/libnsl.a(netdir.o)
dlsym                               /usr/lib/libnsl.a(netdir.o)
dlopen                              /usr/lib/libnsl.a(netdir.o)
dlerror                             /usr/lib/libnsl.a(netdir.o)

These ( I think ) are functions which open and close shared
objects.....hmm but I'm asking for a static binary...?
Here is the top of my Makefile, I'm compiling for Solaris 2.6 using gcc
2.7.2.3

CC       = gcc
IFLAGS   = -I.. -I../support
LFLAGS   = -L../support
CFLAGS   = -g ${IFLAGS} ${LFLAGS} -static
LIBES    = -lsupport -lsocket -lgen -lauth -lfwall -lnsl
LIBC     = /lib/libc.a
LDFLAGS  = -static
LINTFLAGS=
#LKERB    = -lauth -lckrb -lkrb -ldes
MKDEP    = makedepend

I've asked for static in CFLAGS and LDFLAGS.....
Any ideas ?

Kind Regards,
Simon Convey.

---

From: Emil Isberg <[email-masked]>
Date: Tue, 24 Mar 1998 12:06:43 +0100 (MET)

>chroot the ftpd to a secure area in the first place ! )

SUN doesn't like you being able to do certain thing static ..
:-(

On Solaris there is several functions that need shared binaries ..

If you make stubs of dl*() then you will be able to create the static
binary but some functions wont work, namely functions that look up system
files (that may be exported through nis/nis+) and other hosts ..

So you either must create the functions to do that for you, or not
compiling static ..

-- 
/Emil