Skip to contentSkip to conversation

luarocks: fix compilation on 64bits

PATCH New Francois Perrad 5 participants 6 messages Jan 15, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 luarocks: fix compilation on 64bits

---
 package/luarocks/luarocks.mk |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/luarocks/luarocks.mk +1 -1
index 85b6866..6cfd92e 100644
@@ -31,7 +31,7 @@ define HOST_LUAROCKS_INSTALL_CMDS
 	echo "   LUA_LIBDIR = [[$(STAGING_DIR)/usr/lib]],"      >> $(LUAROCKS_CONFIG_FILE)
 	echo "   CC = [[$(TARGET_CC)]],"                        >> $(LUAROCKS_CONFIG_FILE)
 	echo "   LD = [[$(TARGET_CC)]],"                        >> $(LUAROCKS_CONFIG_FILE)
-	echo "   CFLAGS = [[$(TARGET_CFLAGS)]],"                >> $(LUAROCKS_CONFIG_FILE)
+	echo "   CFLAGS = [[$(TARGET_CFLAGS) -fPIC]],"          >> $(LUAROCKS_CONFIG_FILE)
 	echo "   LIBFLAG = [[-shared $(TARGET_LDFLAGS)]],"      >> $(LUAROCKS_CONFIG_FILE)
 	echo "}"                                                >> $(LUAROCKS_CONFIG_FILE)
 	echo "external_deps_dirs = { [[$(STAGING_DIR)/usr]] }"  >> $(LUAROCKS_CONFIG_FILE)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 luarocks: fix compilation on 64bits

Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Francois" == Francois Perrad <[email protected]> writes:

Where did you see this? On the autobuilders? If yes, please add a link.

It's not really about 32bits/64bits, but yes, x86-64 is one of the archs needing -fPIC.

Quoted 9 lines
---
 package/luarocks/luarocks.mk |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/luarocks/luarocks.mk +0 -0
index 85b6866..6cfd92e 100644

package/luarocks/luarocks.mk define HOST_LUAROCKS_INSTALL_CMDS · line 35

Quoted 6 lines
package/luarocks/luarocks.mk +1 -1
@@ -31,7 +31,7 @@ define HOST_LUAROCKS_INSTALL_CMDS
 	echo "   LUA_LIBDIR = [[$(STAGING_DIR)/usr/lib]],"      >> $(LUAROCKS_CONFIG_FILE)
 	echo "   CC = [[$(TARGET_CC)]],"                        >> $(LUAROCKS_CONFIG_FILE)
 	echo "   LD = [[$(TARGET_CC)]],"                        >> $(LUAROCKS_CONFIG_FILE)
-	echo "   CFLAGS = [[$(TARGET_CFLAGS)]],"                >> $(LUAROCKS_CONFIG_FILE)
+	echo "   CFLAGS = [[$(TARGET_CFLAGS) -fPIC]],"          >> $(LUAROCKS_CONFIG_FILE)
 	echo "   LIBFLAG = [[-shared $(TARGET_LDFLAGS)]],"      >> $(LUAROCKS_CONFIG_FILE)

What about BR2_PREFER_STATIC_LIB (for both CFLAGS and LDFLAGS lines)?

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 luarocks: fix compilation on 64bits

2014/1/15 Peter Korsgaard <[email protected]>:

Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Francois" == Francois Perrad <[email protected]> writes:

Where did you see this? On the autobuilders? If yes, please add a link.

in the latest autobuilder report, native Lua modules using the luarocks-package infrastructure are broken :
x86_64 | lbase64-20120820-1 | NOK |
http://autobuild.buildroot.net/results/f28a624f89f4de249a1b7a718f5ae31109ba9171/
x86_64 | luabitop-1.0.2-1 | NOK |
http://autobuild.buildroot.net/results/1ead0a162a251d3e7bf8598036fa06c4befeb3d9/
x86_64 | luaexpat-1.2.0-1 | NOK |
http://autobuild.buildroot.net/results/0544cead086ba51b45dfa1df114787a8f22eaf8d/
x86_64 | luafilesystem-1.6.2-1 | NOK |
http://autobuild.buildroot.net/results/60161d13d596d41dd4059977eb947d72c172f0d5/

Quoted 2 lines

It's not really about 32bits/64bits, but yes, x86-64 is one of the archs needing -fPIC.

Yes, x86_64

Quoted 5 lines
Quoted 4 lines
---
 package/luarocks/luarocks.mk |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines

package/luarocks/luarocks.mk define HOST_LUAROCKS_INSTALL_CMDS · line 35

Quoted 11 lines
package/luarocks/luarocks.mk +1 -1
index 85b6866..6cfd92e 100644
@@ -31,7 +31,7 @@ define HOST_LUAROCKS_INSTALL_CMDS
     echo "   LUA_LIBDIR = [[$(STAGING_DIR)/usr/lib]],"      >> $(LUAROCKS_CONFIG_FILE)
     echo "   CC = [[$(TARGET_CC)]],"                        >> $(LUAROCKS_CONFIG_FILE)
     echo "   LD = [[$(TARGET_CC)]],"                        >> $(LUAROCKS_CONFIG_FILE)
-    echo "   CFLAGS = [[$(TARGET_CFLAGS)]],"                >> $(LUAROCKS_CONFIG_FILE)
+    echo "   CFLAGS = [[$(TARGET_CFLAGS) -fPIC]],"          >> $(LUAROCKS_CONFIG_FILE)
     echo "   LIBFLAG = [[-shared $(TARGET_LDFLAGS)]],"      >> $(LUAROCKS_CONFIG_FILE)

What about BR2_PREFER_STATIC_LIB (for both CFLAGS and LDFLAGS lines)?

native Lua modules/extensions are always shared lib.

Quoted 7 lines

--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#3 lore raw

PATCH 1/1 luarocks: fix compilation on 64bits

Quoted 52 lines · Fran?ois Perrad

2014/1/15 Peter Korsgaard <[email protected]>:

Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Francois" == Francois Perrad <[email protected]> writes:

Where did you see this? On the autobuilders? If yes, please add a link.

in the latest autobuilder report, native Lua modules using the luarocks-package infrastructure are broken :
x86_64 | lbase64-20120820-1 | NOK |
http://autobuild.buildroot.net/results/f28a624f89f4de249a1b7a718f5ae31109ba9171/
x86_64 | luabitop-1.0.2-1 | NOK |
http://autobuild.buildroot.net/results/1ead0a162a251d3e7bf8598036fa06c4befeb3d9/
x86_64 | luaexpat-1.2.0-1 | NOK |
http://autobuild.buildroot.net/results/0544cead086ba51b45dfa1df114787a8f22eaf8d/
x86_64 | luafilesystem-1.6.2-1 | NOK |
http://autobuild.buildroot.net/results/60161d13d596d41dd4059977eb947d72c172f0d5/

Quoted 2 lines

It's not really about 32bits/64bits, but yes, x86-64 is one of the archs needing -fPIC.

Yes, x86_64

Quoted 5 lines
Quoted 4 lines
---
 package/luarocks/luarocks.mk |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines

package/luarocks/luarocks.mk define HOST_LUAROCKS_INSTALL_CMDS · line 35

Quoted 11 lines
package/luarocks/luarocks.mk +1 -1
index 85b6866..6cfd92e 100644
@@ -31,7 +31,7 @@ define HOST_LUAROCKS_INSTALL_CMDS
     echo "   LUA_LIBDIR = [[$(STAGING_DIR)/usr/lib]],"      >> $(LUAROCKS_CONFIG_FILE)
     echo "   CC = [[$(TARGET_CC)]],"                        >> $(LUAROCKS_CONFIG_FILE)
     echo "   LD = [[$(TARGET_CC)]],"                        >> $(LUAROCKS_CONFIG_FILE)
-    echo "   CFLAGS = [[$(TARGET_CFLAGS)]],"                >> $(LUAROCKS_CONFIG_FILE)
+    echo "   CFLAGS = [[$(TARGET_CFLAGS) -fPIC]],"          >> $(LUAROCKS_CONFIG_FILE)
     echo "   LIBFLAG = [[-shared $(TARGET_LDFLAGS)]],"      >> $(LUAROCKS_CONFIG_FILE)

What about BR2_PREFER_STATIC_LIB (for both CFLAGS and LDFLAGS lines)?

native Lua modules/extensions are always shared lib.

Quoted 7 lines

--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Quoted 5 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

I have tested this patch on mips. It fixes this problem:

http://autobuild.buildroot.net/results/e7e/e7ea6946552f72dc27f23ae1aff1665a6aa097c7/

Signature · 1 line
Vincent
#4 lore raw

PATCH 1/1 luarocks: fix compilation on 64bits

In reply to François Perrad
Quoted 21 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Fran?ois" == Fran?ois Perrad <[email protected]> writes:

2014/1/15 Peter Korsgaard <[email protected]>:

Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Francois" == Francois Perrad <[email protected]> writes:

Where did you see this? On the autobuilders? If yes, please add a link.

in the latest autobuilder report, native Lua modules using the luarocks-package infrastructure are broken :
x86_64 | lbase64-20120820-1 | NOK |
http://autobuild.buildroot.net/results/f28a624f89f4de249a1b7a718f5ae31109ba9171/
x86_64 | luabitop-1.0.2-1 | NOK |
http://autobuild.buildroot.net/results/1ead0a162a251d3e7bf8598036fa06c4befeb3d9/
x86_64 | luaexpat-1.2.0-1 | NOK |
http://autobuild.buildroot.net/results/0544cead086ba51b45dfa1df114787a8f22eaf8d/
x86_64 | luafilesystem-1.6.2-1 | NOK |
http://autobuild.buildroot.net/results/60161d13d596d41dd4059977eb947d72c172f0d5/

Quoted 8 lines
Quoted 2 lines

It's not really about 32bits/64bits, but yes, x86-64 is one of the archs needing -fPIC.

Yes, x86_64

Quoted 1 line

What about BR2_PREFER_STATIC_LIB (for both CFLAGS and LDFLAGS lines)?

native Lua modules/extensions are always shared lib.

Ok, committed with a reworded commit message, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw

PATCH 1/1 luarocks: fix compilation on 64bits

Quoted 7 lines · On Wed, 15 Jan 2014 13:14:54 +0100 Peter Korsgaard <[email protected]> wrote:
Quoted 4 lines
Quoted 2 lines

What about BR2_PREFER_STATIC_LIB (for both CFLAGS and LDFLAGS lines)?

native Lua modules/extensions are always shared lib.

Ok, committed with a reworded commit message, thanks.

"Close enough" for the purposes of Buildroot.

Both modules and extensions in either native Lua or as objects from foreign languages (such as "C") may be statically linked into the Lua interpreter.

The process and changes required are well documented, but would probably be impractical to automate in the build system.

So the answer for the BR2_PREFER_STATIC_LIB question is:
"Not supported within the Buildroot system."
or on a positive note:
"Buildroot only supports Lua externals as dynamic libraries."

Mike