Static libraries

Oriental Sensation orientalsensation at gmail.com
Mon Mar 24 08:00:51 UTC 2014


Hello,

(I hope this is the right list to post to. If not, I apologize in
advance and kindly let me know where to direct the question, thanks.)

I installed FreeBSD 10 few days ago, went ahead to recompile world
with a custom kernel. All went great. Then I downloaded PHP and
compiled it also, requesting to compile also OPCache, and all went
great. When I installed PHP, though, I found out that instead of the
usual opcache.so file, I found a libopcache.a file. I then went ahead
and generated a .so file from that, it went fine.

Afterwards, I went ahead and compiled few more PHP extensions only to
find out that all of them were linked statically and produced *.a
files. So I am reckoning that this is a system-wide setting which I
either accidentally turned on or starting with FreeBSD 10, this is the
default behavior.

To summarize: Why is it that the default target for compiling/linking
is static libraries and not shared ones?

The following might shed light:

/etc/src.conf:

WITHOUT_BSNMP="YES"
WITHOUT_CTM="YES"
WITHOUT_DICT="YES"
WITHOUT_EXAMPLES="YES"
WITHOUT_FLOPPY="YES"
WITHOUT_GAMES="YES"
WITHOUT_GCOV="YES"
WITHOUT_IPFILTER="YES"
WITHOUT_IPX="YES"
WITHOUT_LIB32="YES"
WITHOUT_LOCALES="YES"
WITHOUT_LOCATE="YES"
WITHOUT_LPR="YES"
WITHOUT_NDIS="YES"
WITHOUT_NETGRAPH="YES"
WITHOUT_NIS="YES"
WITHOUT_NS_CACHING="YES"
WITHOUT_PF="YES"
WITHOUT_PROFILE="YES"
WITHOUT_RCS="YES"
WITHOUT_RESCUE="YES"
WITHOUT_ROUTED="YES"
WITHOUT_SENDMAIL="YES"
WITHOUT_SHAREDOCS="YES"
WITHOUT_SYSINSTALL="YES"
WITHOUT_WIRELESS="YES"
WITHOUT_ZFS="YES"

/etc/make.conf:

CPUTYPE?=nocona
DOC_LANG=en_US.ISO8859-1
DISABLE_SIZE=yes
NO_PROFILE=yes
WITH_OPENSSL_BASE=yes
CC=clang
CXX=clang++
CPP=clang-cpp
WITH_PIC=yes
CFLAGS=-fPIC
CPPFLAGS=-fPIC -DPIC
CXXFLAGS=-fPIC -DPIC
NO_WERROR=
WERROR=

Thanks in advance for your help, folks.

/OS


More information about the freebsd-questions mailing list