[vlc-commits] contribs: lua: Use an import library when linking, fix building with lld

Martin Storsjö git at videolan.org
Fri Dec 22 11:14:26 CET 2017


vlc | branch: master | Martin Storsjö <martin at martin.st> | Thu Dec 21 23:57:42 2017 +0200| [05d812e41b2c2b3e086f5f81a63341f5a8ff7a3b] | committer: Hugo Beauzée-Luyssen

contribs: lua: Use an import library when linking, fix building with lld

lld doesn't support providing the DLL instead of an import library
when linking.

Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=05d812e41b2c2b3e086f5f81a63341f5a8ff7a3b
---

 contrib/src/lua/implib.patch | 35 +++++++++++++++++++++++++++++++++++
 contrib/src/lua/rules.mak    |  1 +
 2 files changed, 36 insertions(+)

diff --git a/contrib/src/lua/implib.patch b/contrib/src/lua/implib.patch
new file mode 100644
index 0000000000..db37ffe3cf
--- /dev/null
+++ b/contrib/src/lua/implib.patch
@@ -0,0 +1,35 @@
+diff -urN lua-5.1.4-orig/src/Makefile lua-5.1.4/src/Makefile
+--- lua-5.1.4-orig/src/Makefile	2017-12-14 07:30:51.879954115 +0000
++++ lua-5.1.4/src/Makefile	2017-12-14 08:00:29.765126324 +0000
+@@ -23,6 +23,7 @@
+ PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
+ 
+ LUA_A=	liblua.a
++LUA_A_LINK= $(LUA_A)
+ CORE_O=	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
+@@ -52,10 +53,10 @@
+ 	$(RANLIB) $@
+ 
+ $(LUA_T): $(LUA_O) $(LUA_A)
+-	$(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
++	$(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A_LINK) $(LIBS)
+ 
+ $(LUAC_T): $(LUAC_O) $(LUA_A)
+-	$(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
++	$(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A_LINK) $(LIBS)
+ 
+ clean:
+ 	$(RM) $(ALL_T) $(ALL_O)
+@@ -107,8 +108,8 @@
+ #	$(MAKE) all MYCFLAGS=-DLUA_USE_MACOSX
+ 
+ mingw:
+-	$(MAKE) "LUA_A=lua51.dll" "LUA_T=lua.exe" \
+-	"AR=$(CC) -shared -o" "RANLIB=strip --strip-unneeded" \
++	$(MAKE) "LUA_A=lua51.dll" "LUA_T=lua.exe" "LUA_A_LINK=lua51.lib" \
++	"AR=$(CC) -shared -Wl,--out-implib,lua51.lib -o" "RANLIB=strip --strip-unneeded" \
+ 	"MYCFLAGS=-DLUA_BUILD_AS_DLL" "MYLIBS=" "MYLDFLAGS=-s" lua.exe
+ 	$(MAKE) "LUAC_T=luac.exe" luac.exe
+ 
diff --git a/contrib/src/lua/rules.mak b/contrib/src/lua/rules.mak
index b1a27c47fc..cdd4ce936b 100644
--- a/contrib/src/lua/rules.mak
+++ b/contrib/src/lua/rules.mak
@@ -46,6 +46,7 @@ lua: lua-$(LUA_VERSION).tar.gz .sum-lua
 	$(APPLY) $(SRC)/lua/luac-32bits.patch
 	$(APPLY) $(SRC)/lua/no-localeconv.patch
 	$(APPLY) $(SRC)/lua/lua-ios-support.patch
+	$(APPLY) $(SRC)/lua/implib.patch
 ifdef HAVE_WINSTORE
 	$(APPLY) $(SRC)/lua/lua-winrt.patch
 endif



More information about the vlc-commits mailing list