From owner-freebsd-current@freebsd.org Thu Jul 6 01:55:37 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0813FD99696 for ; Thu, 6 Jul 2017 01:55:37 +0000 (UTC) (envelope-from gurenchan@gmail.com) Received: from mail-pf0-x22a.google.com (mail-pf0-x22a.google.com [IPv6:2607:f8b0:400e:c00::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D60857A749 for ; Thu, 6 Jul 2017 01:55:36 +0000 (UTC) (envelope-from gurenchan@gmail.com) Received: by mail-pf0-x22a.google.com with SMTP id q85so3311278pfq.1 for ; Wed, 05 Jul 2017 18:55:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=AdgWLsM0ygXxyknBBPW3L1S4zFDNDKGe4KEr10Xgh8s=; b=Cj2QBtLXL8oXH/EOuZQVJtBFkZyXHI56kxDDoUv7pVVWrNirWkQBokILgMXIAhDqLR 2UsX3du19k9nuKGCZp/whESe/Rx44OoDg6VgfyWT6ZlXgwd6mp6UEN7JpeasoixUd5WX WLLjx3PQzYq7IGopLYIka/xVzee/MSIrRDwTN6tlMWVfVoyJqyPUblra/rQ5i0nZ+bjp yAfL/KADWoQIhoklbGlDEnwdr2CUru3Fu1YsOj3DdFdm9lERDFuRxE5M3KSb5xoLrcwy 29wu1gz7cTZ7X4icT+/tON15Z+PZGVfY8z28tBrhr8MWURs+Z0EP31mP0gJMcW5ncKeX v9sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=AdgWLsM0ygXxyknBBPW3L1S4zFDNDKGe4KEr10Xgh8s=; b=X/DlSTJMtMad377FGiQKamtBrlZW1k0eKSNcmGq2zwEbieJLjEXMa9RCLy4DJ6Mk0g BDsd/ZzH8j5vIh2Oq3UMmY9IFwVHmFLzLJgChcIstHOGz81MZUM3VJS/O3eg5QrmCC8M tC3FrbrJC8WY0tfKIuTu/N31KOVAMbONvQkSNeqkG0eI1xwzH23M61JHa3esTsFKCr1c LxKtmbTwqqZDi4/wknSmfrZeSI3odEPxVFQCm7Pkb8LF9nBis1mF7bDZmDfNHt1T0xIQ fmRqWHukZM4rtFK+noY0fhL60iP0dv0Itk4ehjWWeMTBsPQhFHjDLcM48AQMar0rJWh1 oz/A== X-Gm-Message-State: AIVw1104RY3D06edfaVZ9tggLZ6fVDuXj9OHB935S2KHzXuMACJ2mrkR tKdru5bOLJX9ZzRcaTd9Z+zI66POA/5c X-Received: by 10.84.217.15 with SMTP id o15mr25725125pli.31.1499306136114; Wed, 05 Jul 2017 18:55:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.180.78 with HTTP; Wed, 5 Jul 2017 18:55:35 -0700 (PDT) In-Reply-To: <95831.1499300050@kaos.jnpr.net> References: <95831.1499300050@kaos.jnpr.net> From: blubee blubeeme Date: Thu, 6 Jul 2017 09:55:35 +0800 Message-ID: Subject: Re: .configure && make fails to find ld [dlopen] To: "Simon J. Gerraty" Cc: FreeBSD current Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jul 2017 01:55:37 -0000 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 wrote: > blubee blubeeme 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. >