Hi,

martinblan...@gmail.com wrote on Sat, May 10, 2014 at 01:17:39AM +0000:

> One more quick question.
> Can somebody post the snippet of source code from the FTP program
> which is statically linked with libssl?  I don't actually know what
> it looks like and would like to be able to identify it in the future
> and search for them.

Static or dynamic linking is not a matter of the source code (or the
compiler), but of the linker.

In the case of ftp(1), you can see the following in the file

  /usr/src/usr.bin/ftp/Makefile

PROG=   ftp
LDADD=  [...] -lssl -lcrypto
LDSTATIC= ${STATIC}
.include <bsd.prog.mk>

and /usr/share/mk/bsd.own.mk defines

STATIC?=        -static

per default.  This is used in bsd.prog.mk as follows:

${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${CRTBEGIN} ${CRTEND} ${DPADD}
        ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}

But that's just how it looks like in the OpenBSD base build system.
You can't be sure it looks the same, or even similar, in other
build systems.

Yours,
  Ingo

Reply via email to