[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/1] gnu: lua: Build with dynamic library support.
From: |
Leo Famulari |
Subject: |
Re: [PATCH 1/1] gnu: lua: Build with dynamic library support. |
Date: |
Wed, 28 Oct 2015 18:47:20 -0400 |
I'm still working on this but I found something interesting that I want
to ask the list about. Attached is a diff of the build logs for lua-5.1
from master and lua-5.1 for the patch I sent upthread.
You may notice that they share the `make` invocation, but that gcc is
being invoked with different flags. Does anyone know why that is
happening?
I decided to compare the log files after analyzing the lua-5.1 Makefile
and realizing that my original patch should make no difference for
lua-5.1 (it would make a difference for lua-5.2). And if that is the
case, why am I getting different results?
The missing '-DLUA_USE_LINUX' is the issue for the lua-5.1 in master.
That flag specifies the use of dlopen, among other things.
On Tue, Oct 27, 2015, at 23:32, Leo Famulari wrote:
> Calling all Lua experts! Or even somebody that has used Lua before! ;)
>
> I studied the lua-5.1 and lua-5.2 Makefiles more carefully and I will
> split this up into separate packages for each version, with some
> changes.
>
> On Tue, Oct 27, 2015, at 11:48, Ludovic Courtès wrote:
> > By “fixing the flags”, do you mean that the .so that we have for 5.1
> > does not actually contain position-independent code? That CFLAGS was
> > ignored?
>
> I'm not sure about the state of our lua-5.1's liblua.so. How to test it?
>
> These changes are about building Lua so that it can load Lua libraries
> dynamically. Currently, the lua-5.1 we package lacks this feature.
> Possibly the lua-5.2 is the same way.
>
> > > 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’m not familiar with Lua; what does this command do?
>
> `lua` starts the interactive lua interpreter. Giving it the argument
> `-lname` calls "require('name') before executing script. Typically used
> to load libraries." (quoted from them Lua man page). Some helpful people
> in the Prosody chatroom suggested it as a simple way to test if a Lua
> interpreter can load dynamic libraries or not. Our lua-5.1 can't:
> $ ll `which lua`
> lrwxrwxrwx 7 root guixbuild 61 Dec 31 1969
> /var/guix/profiles/per-user/leo/guix-profile/bin/lua ->
> /gnu/store/fl27mjm8kxp0rj989cd8mj67qjvl0jr3-lua-5.1.5/bin/lua
> $ lua -lssl
> lua: error loading module 'ssl.core' from file
> '/home/leo/.guix-profile/usr/lib/lua/5.1/ssl.so':
> dynamic libraries not enabled; check your Lua installation
> stack traceback:
> [C]: ?
> [C]: in function 'require'
> /home/leo/.guix-profile/usr/share/lua/5.1/ssl.lua:7: in main
> chunk
> [C]: ?
> [C]: ?
>
> > I thought the goal was to get liblua.so for 5.2, but this seems to be
> > testing something else?
>
> By default, building Lua does not create liblua.so, which is why the
> lua51-liblua-so.patch is there. I can look into a similar patch for 5.2.
>
> Also, we need to set up the search paths to help Lua find Lua libraries.
> That can be configured at build time. I figured I would try to get a
> working Lua interpreter in master before working on those things, but I
> am open to guidance.
>
> Revised patches forthcoming.
>
> Leo
master-contrib.diff
Description: Text Data