unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 0/1] lua: Build with dynamic library support
@ 2015-10-27  3:56 Leo Famulari
  2015-10-27  3:56 ` [PATCH 1/1] gnu: " Leo Famulari
  0 siblings, 1 reply; 9+ messages in thread
From: Leo Famulari @ 2015-10-27  3:56 UTC (permalink / raw)
  To: guix-devel

This patch fixes the make flags on lua-5.2 and lua-5.1. Each version has
a different Makefile that handles the flags differently.

Notably, this enables the use of dynamic libraries with Lua.

Leo Famulari (1):
  gnu: lua: Build with dynamic library support.

 gnu/packages/lua.scm | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

-- 
2.6.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/1] gnu: lua: Build with dynamic library support.
  2015-10-27  3:56 [PATCH 0/1] lua: Build with dynamic library support Leo Famulari
@ 2015-10-27  3:56 ` Leo Famulari
  2015-10-27 12:47   ` Ludovic Courtès
  0 siblings, 1 reply; 9+ messages in thread
From: Leo Famulari @ 2015-10-27  3:56 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/lua.scm (lua, lua-5.1)[arguments]: Set the make flags
  properly for each version of lua.
---
 gnu/packages/lua.scm | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index 87f53d1..7699a91 100644
--- a/gnu/packages/lua.scm
+++ 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)
   #:use-module (gnu packages)
   #:use-module (gnu packages readline))
 
@@ -47,7 +48,7 @@
        #:test-target "test"
        #:phases (alist-replace
                  'build
-                 (lambda _ (zero? (system* "make" "CFLAGS=-fPIC" "linux")))
+                 (lambda _ (zero? (system* "make" "MYCFLAGS=-fPIC" "linux")))
                  (alist-replace
                   'install
                   (lambda* (#:key outputs #:allow-other-keys)
@@ -77,7 +78,23 @@ for configuration, scripting, and rapid prototyping.")
                                  version ".tar.gz"))
              (sha256
               (base32 "0cskd4w0g6rdm2q8q3i4n1h3j8kylhs3rq8mxwl9vwlmlxbgqh16"))
-             (patches (list (search-patch "lua51-liblua-so.patch")))))))
+             (patches (list (search-patch "lua51-liblua-so.patch")))))
+    (arguments
+      (substitute-keyword-arguments (package-arguments lua)
+        ((#:phases lua-phases)
+          `(modify-phases ,lua-phases
+             (replace
+               'build
+               (lambda _
+                 (and
+                  (zero? (system* "make" (string-append
+                                    "MYCFLAGS="
+                                    (string-join '("-fPIC "
+                                                   "-DLUA_USE_LINUX "
+                                                   "MYLIBS=-Wl,-E "
+                                                   "-ldl -lreadline "
+                                                   "-lhistory -lncurses")))
+                                    "linux")))))))))))
 
 (define-public luajit
   (package
@@ -89,8 +106,8 @@ for configuration, scripting, and rapid prototyping.")
                                   version ".tar.gz"))
               (sha256
                (base32 "0ydxpqkmsn2c341j4r2v6r5r0ig3kbwv3i9jran3iv81s6r6rgjm"))
-	      (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")))))
     (build-system gnu-build-system)
     (arguments
      '(#:tests? #f                      ;luajit is distributed without tests
-- 
2.6.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/1] gnu: lua: Build with dynamic library support.
  2015-10-27  3:56 ` [PATCH 1/1] gnu: " Leo Famulari
@ 2015-10-27 12:47   ` Ludovic Courtès
  2015-10-27 14:13     ` Leo Famulari
  0 siblings, 1 reply; 9+ messages in thread
From: Ludovic Courtès @ 2015-10-27 12:47 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

Leo Famulari <leo@famulari.name> skribis:

> Notably, this enables the use of dynamic libraries with Lua.

A better subject line for the commit would be:

  gnu: lua-5.2: Build shared libraries.

AFAICS, the problem is only with Lua 5.2:

--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---

Thus I would suggest leaving ‘lua-5.1’ unchanged.

> * gnu/packages/lua.scm (lua, lua-5.1)[arguments]: Set the make flags
>   properly for each version of lua.

[...]

> +++ 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)

Looks like this line is not needed, is it?

>         #:phases (alist-replace
>                   'build
> -                 (lambda _ (zero? (system* "make" "CFLAGS=-fPIC" "linux")))
> +                 (lambda _ (zero? (system* "make" "MYCFLAGS=-fPIC" "linux")))

I just tried and AFAICS this line has no effect: Lua 5.2 still lacks
liblua.so.  Am I missing something?

> +          `(modify-phases ,lua-phases
> +             (replace
> +               'build
> +               (lambda _
> +                 (and
> +                  (zero? (system* "make" (string-append
> +                                    "MYCFLAGS="
> +                                    (string-join '("-fPIC "
> +                                                   "-DLUA_USE_LINUX "
> +                                                   "MYLIBS=-Wl,-E "
> +                                                   "-ldl -lreadline "
> +                                                   "-lhistory -lncurses")))
> +                                    "linux")))))))))))

This is in ‘lua-5.1’, so it’s unnecessary AFAICS.

> @@ -89,8 +106,8 @@ for configuration, scripting, and rapid prototyping.")
>                                    version ".tar.gz"))
>                (sha256
>                 (base32 "0ydxpqkmsn2c341j4r2v6r5r0ig3kbwv3i9jran3iv81s6r6rgjm"))
> -	      (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")))))

Unnecessary too.

Thanks for looking into it!

Ludo’.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/1] gnu: lua: Build with dynamic library support.
  2015-10-27 12:47   ` Ludovic Courtès
@ 2015-10-27 14:13     ` Leo Famulari
  2015-10-27 15:48       ` Ludovic Courtès
  0 siblings, 1 reply; 9+ messages in thread
From: Leo Famulari @ 2015-10-27 14:13 UTC (permalink / raw)
  To: guix-devel

On Tue, Oct 27, 2015, at 08:47, Ludovic Courtès wrote:
> Leo Famulari <leo@famulari.name> skribis:
> 
> > Notably, this enables the use of dynamic libraries with Lua.
> 
> A better subject line for the commit would be:
> 
>   gnu: lua-5.2: Build shared libraries.
> 
> AFAICS, the problem is only with Lua 5.2:
> 
> --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---
> 
> Thus I would suggest leaving ‘lua-5.1’ 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.

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.

> > * gnu/packages/lua.scm (lua, lua-5.1)[arguments]: Set the make flags
> >   properly for each version of lua.
> 
> [...]
> 
> > +++ 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)
> 
> Looks like this line is not needed, is it?

I thought that was necessary to use substitute-keyword-arguments.
 
> >         #:phases (alist-replace
> >                   'build
> > -                 (lambda _ (zero? (system* "make" "CFLAGS=-fPIC" "linux")))
> > +                 (lambda _ (zero? (system* "make" "MYCFLAGS=-fPIC" "linux")))
> 
> 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

> > +          `(modify-phases ,lua-phases
> > +             (replace
> > +               'build
> > +               (lambda _
> > +                 (and
> > +                  (zero? (system* "make" (string-append
> > +                                    "MYCFLAGS="
> > +                                    (string-join '("-fPIC "
> > +                                                   "-DLUA_USE_LINUX "
> > +                                                   "MYLIBS=-Wl,-E "
> > +                                                   "-ldl -lreadline "
> > +                                                   "-lhistory -lncurses")))
> > +                                    "linux")))))))))))
> 
> This is in ‘lua-5.1’, so it’s unnecessary AFAICS.
> 
> > @@ -89,8 +106,8 @@ for configuration, scripting, and rapid prototyping.")
> >                                    version ".tar.gz"))
> >                (sha256
> >                 (base32 "0ydxpqkmsn2c341j4r2v6r5r0ig3kbwv3i9jran3iv81s6r6rgjm"))
> > -	      (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")))))
> 
> Unnecessary too.

I figured that I should remove this tabulation while I was touching the
file.

> 
> Thanks for looking into it!

I will look into it again.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/1] gnu: lua: Build with dynamic library support.
  2015-10-27 14:13     ` Leo Famulari
@ 2015-10-27 15:48       ` Ludovic Courtès
  2015-10-28  3:32         ` Leo Famulari
  0 siblings, 1 reply; 9+ messages in thread
From: Ludovic Courtès @ 2015-10-27 15:48 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

Leo Famulari <leo@famulari.name> skribis:

> On Tue, Oct 27, 2015, at 08:47, Ludovic Courtès wrote:
>> Leo Famulari <leo@famulari.name> skribis:
>> 
>> > Notably, this enables the use of dynamic libraries with Lua.
>> 
>> A better subject line for the commit would be:
>> 
>>   gnu: lua-5.2: Build shared libraries.
>> 
>> AFAICS, the problem is only with Lua 5.2:
>> 
>> --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---
>> 
>> Thus I would suggest leaving ‘lua-5.1’ 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 “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?

> 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.
>> 
>> [...]
>> 
>> > +++ 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)
>> 
>> 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=-fPIC" "linux")))
>> > +                 (lambda _ (zero? (system* "make" "MYCFLAGS=-fPIC" "linux")))
>> 
>> 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’m 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 "0ydxpqkmsn2c341j4r2v6r5r0ig3kbwv3i9jran3iv81s6r6rgjm"))
>> > -	      (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")))))
>> 
>> Unnecessary too.
>
> I figured that I should remove this tabulation while I was touching the
> file.

OK, it can’t hurt, indeed.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/1] gnu: lua: Build with dynamic library support.
  2015-10-27 15:48       ` Ludovic Courtès
@ 2015-10-28  3:32         ` Leo Famulari
  2015-10-28 22:47           ` Leo Famulari
  2015-10-29 20:46           ` Ludovic Courtès
  0 siblings, 2 replies; 9+ messages in thread
From: Leo Famulari @ 2015-10-28  3:32 UTC (permalink / raw)
  To: guix-devel

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/1] gnu: lua: Build with dynamic library support.
  2015-10-28  3:32         ` Leo Famulari
@ 2015-10-28 22:47           ` Leo Famulari
  2015-10-29 20:49             ` Ludovic Courtès
  2015-10-29 20:46           ` Ludovic Courtès
  1 sibling, 1 reply; 9+ messages in thread
From: Leo Famulari @ 2015-10-28 22:47 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 3211 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: master-contrib.diff --]
[-- Type: text/x-diff; name="master-contrib.diff", Size: 11616 bytes --]

--- lua-5.1-master.log	2015-10-28 00:55:35.056412401 -0400
+++ lua-5.1-contrib.log	2015-10-28 18:17:29.127392079 -0400
@@ -1,6 +1,3 @@
-The following derivation will be built:
-   /gnu/store/djjyfzi09p8ikjq03vv7rkscjmg9sxq8-lua-5.1.5.drv
-@ build-started /gnu/store/djjyfzi09p8ikjq03vv7rkscjmg9sxq8-lua-5.1.5.drv - x86_64-linux /usr/local/var/log/guix/drvs/dj//jyfzi09p8ikjq03vv7rkscjmg9sxq8-lua-5.1.5.drv.bz2
 starting phase `set-paths'
 environment variable `PATH' set to `/gnu/store/xz8c9ihn3p1d8xqkhzf54bjvjqzvqkc0-tar-1.28/bin:/gnu/store/8m7mgixi5539vqrr1vd1nrvh96vjl66j-gzip-1.6/bin:/gnu/store/yq9vkx7f4zw17gs6b09bg4arcgmmjgxn-bzip2-1.0.6/bin:/gnu/store/hk31a1xlgf6n3yi1yzbdyd2bnjmxc60m-xz-5.0.4/bin:/gnu/store/wl84nj6x2mz7zf5r0ajx5gpi0p689ags-file-5.22/bin:/gnu/store/p1h463zxk0f56jl7snw7s8wxvz1k542q-diffutils-3.3/bin:/gnu/store/0xm4q87qi07gcig4riflrf65vyk1k0mp-patch-2.7.5/bin:/gnu/store/g55pwwrmgi58n1yr57m7vc0y69v1ba89-sed-4.2.2/bin:/gnu/store/7fk9v37a5q4r5sygywq0q0qg7iqrj517-findutils-4.4.2/bin:/gnu/store/k8qgvgwn5anbfy8r70h938kxgd46cyxx-gawk-4.1.3/bin:/gnu/store/021rg9bs7xivw0acp1yr0rxw6mf3h64d-grep-2.21/bin:/gnu/store/mnwjrkbfzkb5ifhqf8hssf3cxfvg11l6-coreutils-8.24/bin:/gnu/store/22k2zmc74dvnri91ma0lwxyyhfi1srk0-make-4.1/bin:/gnu/store/311nvir0pz1mhf0mgsmfrw00qfj7yq0j-bash-4.3.39/bin:/gnu/store/k6r37137lfpg3l3igi50c7lj2za7kqly-ld-wrapper-0/bin:/gnu/store/y5psndwpbbkjrf856x757psb708y62dn-binutils-2.25.1/bin:/gnu/store/hddjjpkfvwaf1j1q3qwpvby0rid3k8by-gcc-4.9.3/bin:/gnu/store/qv7bk62c22ms9i11dhfl71hnivyc82k2-glibc-2.22/bin:/gnu/store/qv7bk62c22ms9i11dhfl71hnivyc82k2-glibc-2.22/sbin:/gnu/store/ksgpmjqi9l8z012n18zbac1bijs1jdrn-readline-6.3/bin:/gnu/store/mahpzasbp7i0v7aqq8970rl7paq5mwln-ncurses-6.0/bin'
 environment variable `CPATH' set to `/gnu/store/yq9vkx7f4zw17gs6b09bg4arcgmmjgxn-bzip2-1.0.6/include:/gnu/store/hk31a1xlgf6n3yi1yzbdyd2bnjmxc60m-xz-5.0.4/include:/gnu/store/wl84nj6x2mz7zf5r0ajx5gpi0p689ags-file-5.22/include:/gnu/store/k8qgvgwn5anbfy8r70h938kxgd46cyxx-gawk-4.1.3/include:/gnu/store/22k2zmc74dvnri91ma0lwxyyhfi1srk0-make-4.1/include:/gnu/store/y5psndwpbbkjrf856x757psb708y62dn-binutils-2.25.1/include:/gnu/store/hddjjpkfvwaf1j1q3qwpvby0rid3k8by-gcc-4.9.3/include:/gnu/store/qv7bk62c22ms9i11dhfl71hnivyc82k2-glibc-2.22/include:/gnu/store/ksgpmjqi9l8z012n18zbac1bijs1jdrn-readline-6.3/include:/gnu/store/lyn2331ilik14yy2jqhndshvxmv9r6w5-linux-libre-headers-3.14.37/include:/gnu/store/mahpzasbp7i0v7aqq8970rl7paq5mwln-ncurses-6.0/include'
@@ -127,83 +124,77 @@
 phase `patch-generated-file-shebangs' succeeded after 0.0 seconds
 starting phase `build'
 cd src && make linux V=5.1 R=5.1.5
-make[1]: Entering directory '/tmp/nix-build-lua-5.1.5.drv-0/lua-5.1.5/src'
+make[1]: Entering directory '/home/leo/tmp/nix-build-lua-5.1.5.drv-0/lua-5.1.5/src'
 make all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
-make[2]: Entering directory '/tmp/nix-build-lua-5.1.5.drv-0/lua-5.1.5/src'
-gcc -fPIC   -c -o lapi.o lapi.c
-gcc -fPIC   -c -o lcode.o lcode.c
-gcc -fPIC   -c -o ldebug.o ldebug.c
-gcc -fPIC   -c -o ldo.o ldo.c
-gcc -fPIC   -c -o ldump.o ldump.c
-gcc -fPIC   -c -o lfunc.o lfunc.c
-gcc -fPIC   -c -o lgc.o lgc.c
-gcc -fPIC   -c -o llex.o llex.c
-gcc -fPIC   -c -o lmem.o lmem.c
-gcc -fPIC   -c -o lobject.o lobject.c
-gcc -fPIC   -c -o lopcodes.o lopcodes.c
-gcc -fPIC   -c -o lparser.o lparser.c
-gcc -fPIC   -c -o lstate.o lstate.c
-gcc -fPIC   -c -o lstring.o lstring.c
-gcc -fPIC   -c -o ltable.o ltable.c
-gcc -fPIC   -c -o ltm.o ltm.c
-gcc -fPIC   -c -o lundump.o lundump.c
-gcc -fPIC   -c -o lvm.o lvm.c
-gcc -fPIC   -c -o lzio.o lzio.c
-gcc -fPIC   -c -o lauxlib.o lauxlib.c
-gcc -fPIC   -c -o lbaselib.o lbaselib.c
-gcc -fPIC   -c -o ldblib.o ldblib.c
-gcc -fPIC   -c -o liolib.o liolib.c
-gcc -fPIC   -c -o lmathlib.o lmathlib.c
-gcc -fPIC   -c -o loslib.o loslib.c
-gcc -fPIC   -c -o ltablib.o ltablib.c
-gcc -fPIC   -c -o lstrlib.o lstrlib.c
-gcc -fPIC   -c -o loadlib.o loadlib.c
-gcc -fPIC   -c -o linit.o linit.c
+make[2]: Entering directory '/home/leo/tmp/nix-build-lua-5.1.5.drv-0/lua-5.1.5/src'
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o lapi.o lapi.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o lcode.o lcode.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o ldebug.o ldebug.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o ldo.o ldo.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o ldump.o ldump.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o lfunc.o lfunc.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o lgc.o lgc.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o llex.o llex.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o lmem.o lmem.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o lobject.o lobject.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o lopcodes.o lopcodes.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o lparser.o lparser.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o lstate.o lstate.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o lstring.o lstring.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o ltable.o ltable.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o ltm.o ltm.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o lundump.o lundump.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o lvm.o lvm.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o lzio.o lzio.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o lauxlib.o lauxlib.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o lbaselib.o lbaselib.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o ldblib.o ldblib.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o liolib.o liolib.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o lmathlib.o lmathlib.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o loslib.o loslib.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o ltablib.o ltablib.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o lstrlib.o lstrlib.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o loadlib.o loadlib.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o linit.o linit.c
 ar rcu liblua.a lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o loadlib.o linit.o	# DLL needs all object files
 ar: `u' modifier ignored since `D' is the default (see `U')
 ranlib liblua.a
-gcc -fPIC   -c -o lua.o lua.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o lua.o lua.c
 gcc -o lua  lua.o liblua.a -lm -Wl,-E -ldl -lreadline -lhistory -lncurses
-liblua.a(loslib.o): In function `os_tmpname':
-loslib.c:(.text+0x1a5): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
-gcc -fPIC   -c -o luac.o luac.c
-gcc -fPIC   -c -o print.o print.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o luac.o luac.c
+gcc -O2 -Wall -DLUA_USE_LINUX -fPIC   -c -o print.o print.c
 gcc -o luac  luac.o print.o liblua.a -lm -Wl,-E -ldl -lreadline -lhistory -lncurses
 gcc -shared -ldl -Wl,-soname,liblua.so.5.1 -o liblua.so.5.1.5 lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o loadlib.o linit.o -lm 
-loslib.o: In function `os_tmpname':
-loslib.c:(.text+0x1a5): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
 ln -sf liblua.so.5.1.5 liblua.so.5.1
 ln -sf liblua.so.5.1.5 liblua.so
-make[2]: Leaving directory '/tmp/nix-build-lua-5.1.5.drv-0/lua-5.1.5/src'
-make[1]: Leaving directory '/tmp/nix-build-lua-5.1.5.drv-0/lua-5.1.5/src'
-phase `build' succeeded after 1.6 seconds
+make[2]: Leaving directory '/home/leo/tmp/nix-build-lua-5.1.5.drv-0/lua-5.1.5/src'
+make[1]: Leaving directory '/home/leo/tmp/nix-build-lua-5.1.5.drv-0/lua-5.1.5/src'
+phase `build' succeeded after 5.1 seconds
 starting phase `check'
 src/lua test/hello.lua
 Hello world, from Lua 5.1!
 phase `check' succeeded after 0.0 seconds
 starting phase `install'
-cd src && mkdir -p /gnu/store/fl27mjm8kxp0rj989cd8mj67qjvl0jr3-lua-5.1.5/bin /gnu/store/fl27mjm8kxp0rj989cd8mj67qjvl0jr3-lua-5.1.5/include /gnu/store/fl27mjm8kxp0rj989cd8mj67qjvl0jr3-lua-5.1.5/lib /gnu/store/fl27mjm8kxp0rj989cd8mj67qjvl0jr3-lua-5.1.5/share/man/man1 /gnu/store/fl27mjm8kxp0rj989cd8mj67qjvl0jr3-lua-5.1.5/share/lua/5.1 /gnu/store/fl27mjm8kxp0rj989cd8mj67qjvl0jr3-lua-5.1.5/lib/lua/5.1
-cd src && install -p -m 0755 lua luac /gnu/store/fl27mjm8kxp0rj989cd8mj67qjvl0jr3-lua-5.1.5/bin
-cd src && install -p -m 0644 lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp /gnu/store/fl27mjm8kxp0rj989cd8mj67qjvl0jr3-lua-5.1.5/include
-cd src && install -p -m 0644 liblua.a liblua.so liblua.so.5.1 /gnu/store/fl27mjm8kxp0rj989cd8mj67qjvl0jr3-lua-5.1.5/lib
-cd doc && install -p -m 0644 lua.1 luac.1 /gnu/store/fl27mjm8kxp0rj989cd8mj67qjvl0jr3-lua-5.1.5/share/man/man1
+cd src && mkdir -p /gnu/store/v51lrdxh8h09bf5d3ml92g9nkxqmympr-lua-5.1.5/bin /gnu/store/v51lrdxh8h09bf5d3ml92g9nkxqmympr-lua-5.1.5/include /gnu/store/v51lrdxh8h09bf5d3ml92g9nkxqmympr-lua-5.1.5/lib /gnu/store/v51lrdxh8h09bf5d3ml92g9nkxqmympr-lua-5.1.5/share/man/man1 /gnu/store/v51lrdxh8h09bf5d3ml92g9nkxqmympr-lua-5.1.5/share/lua/5.1 /gnu/store/v51lrdxh8h09bf5d3ml92g9nkxqmympr-lua-5.1.5/lib/lua/5.1
+cd src && install -p -m 0755 lua luac /gnu/store/v51lrdxh8h09bf5d3ml92g9nkxqmympr-lua-5.1.5/bin
+cd src && install -p -m 0644 lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp /gnu/store/v51lrdxh8h09bf5d3ml92g9nkxqmympr-lua-5.1.5/include
+cd src && install -p -m 0644 liblua.a liblua.so liblua.so.5.1 /gnu/store/v51lrdxh8h09bf5d3ml92g9nkxqmympr-lua-5.1.5/lib
+cd doc && install -p -m 0644 lua.1 luac.1 /gnu/store/v51lrdxh8h09bf5d3ml92g9nkxqmympr-lua-5.1.5/share/man/man1
 phase `install' succeeded after 0.0 seconds
 starting phase `patch-shebangs'
 phase `patch-shebangs' succeeded after 0.0 seconds
 starting phase `strip'
-stripping binaries in "/gnu/store/fl27mjm8kxp0rj989cd8mj67qjvl0jr3-lua-5.1.5/lib" with "strip" and flags ("--strip-debug")
-stripping binaries in "/gnu/store/fl27mjm8kxp0rj989cd8mj67qjvl0jr3-lua-5.1.5/bin" with "strip" and flags ("--strip-debug")
-phase `strip' succeeded after 0.0 seconds
+stripping binaries in "/gnu/store/v51lrdxh8h09bf5d3ml92g9nkxqmympr-lua-5.1.5/lib" with "strip" and flags ("--strip-debug")
+stripping binaries in "/gnu/store/v51lrdxh8h09bf5d3ml92g9nkxqmympr-lua-5.1.5/bin" with "strip" and flags ("--strip-debug")
+phase `strip' succeeded after 0.1 seconds
 starting phase `validate-runpath'
-validating RUNPATH of 2 binaries in "/gnu/store/fl27mjm8kxp0rj989cd8mj67qjvl0jr3-lua-5.1.5/lib"...
-validating RUNPATH of 2 binaries in "/gnu/store/fl27mjm8kxp0rj989cd8mj67qjvl0jr3-lua-5.1.5/bin"...
+validating RUNPATH of 2 binaries in "/gnu/store/v51lrdxh8h09bf5d3ml92g9nkxqmympr-lua-5.1.5/lib"...
+validating RUNPATH of 2 binaries in "/gnu/store/v51lrdxh8h09bf5d3ml92g9nkxqmympr-lua-5.1.5/bin"...
 phase `validate-runpath' succeeded after 0.0 seconds
 starting phase `validate-documentation-location'
 phase `validate-documentation-location' succeeded after 0.0 seconds
 starting phase `delete-info-dir-file'
 phase `delete-info-dir-file' succeeded after 0.0 seconds
 starting phase `compress-documentation'
-compressing documentation in '/gnu/store/fl27mjm8kxp0rj989cd8mj67qjvl0jr3-lua-5.1.5/share/man' with "gzip" and flags ("--best" "--no-name")
+compressing documentation in '/gnu/store/v51lrdxh8h09bf5d3ml92g9nkxqmympr-lua-5.1.5/share/man' with "gzip" and flags ("--best" "--no-name")
 phase `compress-documentation' succeeded after 0.0 seconds
-@ build-succeeded /gnu/store/djjyfzi09p8ikjq03vv7rkscjmg9sxq8-lua-5.1.5.drv -
-/gnu/store/fl27mjm8kxp0rj989cd8mj67qjvl0jr3-lua-5.1.5

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/1] gnu: lua: Build with dynamic library support.
  2015-10-28  3:32         ` Leo Famulari
  2015-10-28 22:47           ` Leo Famulari
@ 2015-10-29 20:46           ` Ludovic Courtès
  1 sibling, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2015-10-29 20:46 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

Leo Famulari <leo@famulari.name> skribis:

> 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?

Good question.  I was surprised to see that

  ldd /gnu/store/fl27mjm8kxp0rj989cd8mj67qjvl0jr3-lua-5.1.5/bin/lua | grep liblua

returns nothing.

> These changes are about building Lua so that it can load Lua libraries
> dynamically.

Oh OK, that wasn’t clear to me.

> $ 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

OK.

> Also, we need to set up the search paths to help Lua find Lua libraries.
> That can be configured at build time.

Indeed.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/1] gnu: lua: Build with dynamic library support.
  2015-10-28 22:47           ` Leo Famulari
@ 2015-10-29 20:49             ` Ludovic Courtès
  0 siblings, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2015-10-29 20:49 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

Leo Famulari <leo@famulari.name> skribis:

> 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?

Maybe it does have an effect after all?  Sorry for any confusion I might
have spread.

> 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.

So you found the culprit?

Ludo’.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-10-29 20:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-27  3:56 [PATCH 0/1] lua: Build with dynamic library support Leo Famulari
2015-10-27  3:56 ` [PATCH 1/1] gnu: " Leo Famulari
2015-10-27 12:47   ` Ludovic Courtès
2015-10-27 14:13     ` Leo Famulari
2015-10-27 15:48       ` Ludovic Courtès
2015-10-28  3:32         ` Leo Famulari
2015-10-28 22:47           ` Leo Famulari
2015-10-29 20:49             ` Ludovic Courtès
2015-10-29 20:46           ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).