From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Famulari Subject: Re: [PATCH 1/7] gnu: lua: Build with support for dynamic libraries. Date: Tue, 30 Aug 2016 02:37:13 -0400 Message-ID: <20160830063713.GB4193@jasmine> References: <20160822193918.27397-1-rekado@elephly.net> <20160822193918.27397-2-rekado@elephly.net> <20160823020240.3304b5a4@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1becfp-0005iP-45 for guix-devel@gnu.org; Tue, 30 Aug 2016 02:37:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1becfk-0000Sb-TX for guix-devel@gnu.org; Tue, 30 Aug 2016 02:37:28 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:37889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1becfi-0000R2-Rn for guix-devel@gnu.org; Tue, 30 Aug 2016 02:37:24 -0400 Content-Disposition: inline In-Reply-To: <20160823020240.3304b5a4@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: gno Cc: guix-devel@gnu.org On Tue, Aug 23, 2016 at 02:02:40AM +0200, gno wrote: > On Mon, 22 Aug 2016 21:39:12 +0200 > Ricardo Wurmus wrote: > > + #:make-flags > > + '("CFLAGS=-fPIC -DLUA_DL_DLOPEN -DLUA_USE_POSIX" > > + "linux") > > This doesn't work for me - lua-lgi still complains about lua not being > able to dynamically load. But this does work: > > (replace 'build > (lambda _ (zero? (system* "make" > "LDFLAGS=-ldl" "CFLAGS=-fPIC -DLUA_USE_DLOPEN" "linux")))) > > I tried adding LDFLAGS in #make-flags to no avail. Based on my reading of the Makefile (and the 'src/Makefile'), I think we should be using MYCFLAGS and MYLDFLAGS. CFLAGS and LDFLAGS include MYCFLAGS and MYLDFLAGS, respectively, but they also include some default flags and platform-dependent flags. By setting CFLAGS and LDFLAGS directly, we lose those default and platform-dependent values. By the way, '-ldl' does get passed to GCC in 'src/Makefile', but I don't think it gets passed to the linker, although my knowledge here is not strong.