From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 1/1] gnu: lua: Build with dynamic library support. Date: Tue, 27 Oct 2015 16:48:27 +0100 Message-ID: <87pp00tir8.fsf@gnu.org> References: <45ab1898e5c08ef1f8c7070eae77c58e5dd40296.1445918045.git.leo@famulari.name> <87oafkv5pz.fsf@gnu.org> <1445955233.2825572.421511113.088B9586@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zr6UF-0001sA-E0 for guix-devel@gnu.org; Tue, 27 Oct 2015 11:48:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zr6UA-0004XF-9T for guix-devel@gnu.org; Tue, 27 Oct 2015 11:48:35 -0400 In-Reply-To: <1445955233.2825572.421511113.088B9586@webmail.messagingengine.com> (Leo Famulari's message of "Tue, 27 Oct 2015 10:13:53 -0400") 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Leo Famulari Cc: guix-devel@gnu.org Leo Famulari skribis: > On Tue, Oct 27, 2015, at 08:47, Ludovic Court=C3=A8s wrote: >> Leo Famulari skribis: >>=20 >> > Notably, this enables the use of dynamic libraries with Lua. >>=20 >> A better subject line for the commit would be: >>=20 >> gnu: lua-5.2: Build shared libraries. >>=20 >> AFAICS, the problem is only with Lua 5.2: >>=20 >> --8<---------------cut here---------------start------------->8--- >> $ ls $(guix build lua-5.1)/lib >> liblua.a liblua.so liblua.so.5.1 lua >> $ ls $(guix build lua-5.2)/lib >> liblua.a lua pkgconfig >> --8<---------------cut here---------------end--------------->8--- >>=20 >> Thus I would suggest leaving =E2=80=98lua-5.1=E2=80=99 unchanged. > > The make flags were broken before, for both 5.1 and 5.2, but in > different ways. So the commit isn't about enabling shared libraries but > fixing the flags. And I'm not sure about using Lua as a library. I was > more interested in using other libraries with Lua. By =E2=80=9Cfixing the flags=E2=80=9D, do you mean that the .so that we hav= e for 5.1 does not actually contain position-independent code? That CFLAGS was ignored? > For 5.2, MYCFLAGS is available to "users" to append flags to what is set > by the platform flag ("linux"). > > For 5.1, MYCFLAGS does NOT append, so you must manually copy the > platform dependent flags onto the command-line and then append your > flags. > > In both cases, our build instructions clobber the platform dependent > flags. OK. >> > * gnu/packages/lua.scm (lua, lua-5.1)[arguments]: Set the make flags >> > properly for each version of lua. >>=20 >> [...] >>=20 >> > +++ b/gnu/packages/lua.scm >> > @@ -24,6 +24,7 @@ >> > #:use-module (guix packages) >> > #:use-module (guix download) >> > #:use-module (guix build-system gnu) >> > + #:use-module (guix utils) >>=20 >> Looks like this line is not needed, is it? > > I thought that was necessary to use substitute-keyword-arguments. Oh right. >> > #:phases (alist-replace >> > 'build >> > - (lambda _ (zero? (system* "make" "CFLAGS=3D-fPIC" "l= inux"))) >> > + (lambda _ (zero? (system* "make" "MYCFLAGS=3D-fPIC" = "linux"))) >>=20 >> I just tried and AFAICS this line has no effect: Lua 5.2 still lacks >> liblua.so. Am I missing something? > > I will have to look into it again. I tested the results by starting the > Lua interpreter while linking a shared library: > $ lua -lssl I=E2=80=99m not familiar with Lua; what does this command do? I thought the goal was to get liblua.so for 5.2, but this seems to be testing something else? >> > @@ -89,8 +106,8 @@ for configuration, scripting, and rapid prototyping= .") >> > version ".tar.gz")) >> > (sha256 >> > (base32 "0ydxpqkmsn2c341j4r2v6r5r0ig3kbwv3i9jran3iv81s= 6r6rgjm")) >> > - (patches (list (search-patch "luajit-symlinks.patch") >> > - (search-patch "luajit-no_ldconfig.patch"))))) >> > + (patches (list (search-patch "luajit-symlinks.patch") >> > + (search-patch "luajit-no_ldconfig.patch"= ))))) >>=20 >> Unnecessary too. > > I figured that I should remove this tabulation while I was touching the > file. OK, it can=E2=80=99t hurt, indeed. Thanks, Ludo=E2=80=99.