Re: .configure && make fails to find ld [dlopen]

From: blubee blubeeme <gurenchan_at_gmail.com>
Date: Thu, 6 Jul 2017 09:55:35 +0800
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
   11. HOSTTYPE=FreeBSD
   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"
>&5
$as_echo_n "checking for dlopen in -ldl... " >&6; }
if ${ac_cv_lib_dl_dlopen+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
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
instead?

Best,
Owen

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

> blubee blubeeme <gurenchan_at_gmail.com> wrote:
> > I run autoreconf -fi and it asks me to add AC_CONFIG_MACRO_DIRS([m4]) to
> my
> > configure.ac 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.
>
Received on Wed Jul 05 2017 - 23:55:37 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:12 UTC