Thanks for the reply, I haven't set any -static in my env variables or
anything like that. Here's a brief output of my env

   1. OSTYPE=FreeBSD
   2. MACHTYPE=x86_64
   3. CC=clang
   4. PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
   5. EDITOR=vi
   6. LDFLAGS=-L/usr/local/lib
   7. LD_LIBRARY_PATH=/usr/local/llvm38/lib
   8. CPPFLAGS=-I/usr/local/include
   9. CXX=clang++
   10. SHELL=/bin/tcsh
   12. CFLAGS=-I/usr/local/include

the linking to ldl is being done automatically since I call autoreconf -fi
and that sets up an m4 directory. grep -rn "\-ldl" in the root of the
source folder shows that the built in configure script and the scripts in
the m4 directory sets up those dlopen link example

    # if libdl is installed we need to link against it
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl"
$as_echo_n "checking for dlopen in -ldl... " >&6; }
if ${ac_cv_lib_dl_dlopen+:} false; then :
  $as_echo_n "(cached) " >&6
LIBS="-ldl  $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext

those are sprinkled all over the place, how do I avoid that and use libc


On Thu, Jul 6, 2017 at 8:14 AM, Simon J. Gerraty <> wrote:

> blubee blubeeme <> wrote:
> > I run autoreconf -fi and it asks me to add AC_CONFIG_MACRO_DIRS([m4]) to
> my
> > file, which I do. It creates a ./m4 directory and proceeds.
> >
> > After running .configure --prefix=/tmp [for testing] that' also goes
> fine,
> > except .configure cannot find dlopen
> > checking for dlopen in -ldl... no
> dlopen is actually implemeted in the rtld - so you need to link at least
> one shared lib (usually libc) to get it.
> > make also fails when it comes time to link because of the dlopen although
> > it's a part of FreeBSD libc
> Check that you don't have -static or equivalent in CFLAGS/LDFLAGS.
_______________________________________________ mailing list
To unsubscribe, send any mail to ""

Reply via email to