Date: Thu, 6 Jul 2017 09:55:35 +0800 From: blubee blubeeme <gurenchan@gmail.com> To: "Simon J. Gerraty" <sjg@juniper.net> Cc: FreeBSD current <freebsd-current@freebsd.org> Subject: Re: .configure && make fails to find ld [dlopen] Message-ID: <CALM2mEkhrFfFOYoXDfjU%2B1GQY5=ZQierMm%2BEZF56Td-a9wG3aw@mail.gmail.com> In-Reply-To: <95831.1499300050@kaos.jnpr.net> References: <CALM2mEnzAKWLzRi4=KnP2GTjHEHDjLzPx8vqDmDixm=A3ugt5Q@mail.gmail.com> <95831.1499300050@kaos.jnpr.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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@juniper.net> wrote: > blubee blubeeme <gurenchan@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. >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALM2mEkhrFfFOYoXDfjU%2B1GQY5=ZQierMm%2BEZF56Td-a9wG3aw>