[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: [PATCH] Create an import library needed for lld
- From: Marvin Scholz <epirat07@...>
- Date: Tue, 9 Nov 2021 19:38:28 +0100
lld versions below lld 13 didn't support linking directly with a DLL
instead of an import library.
Based on a patch by Martin Storsjö
---
src/Makefile | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/Makefile b/src/Makefile
index f78c0b8..f4d4cbe 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -33,6 +33,7 @@ CMCFLAGS=
PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris
LUA_A= liblua.a
+LUA_A_LINK= $(LUA_A)
CORE_O= lapi.o lcode.o lctype.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
LIB_O= lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o
BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
@@ -61,10 +62,10 @@ $(LUA_A): $(BASE_O)
$(RANLIB) $@
$(LUA_T): $(LUA_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+ $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A_LINK) $(LIBS)
$(LUAC_T): $(LUAC_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+ $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A_LINK) $(LIBS)
test:
./$(LUA_T) -v
@@ -129,10 +130,10 @@ Darwin macos macosx:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX -DLUA_USE_READLINE" SYSLIBS="-lreadline"
mingw:
- $(MAKE) "LUA_A=lua54.dll" "LUA_T=lua.exe" \
- "AR=$(CC) -shared -o" "RANLIB=strip --strip-unneeded" \
+ $(MAKE) "LUA_A=lua54.dll" "LUA_T=lua.exe" "LUA_A_LINK=lua54.lib" \
+ "AR=$(CC) -shared -Wl,--out-implib,lua54.lib $(LDFLAGS) -o" "RANLIB=strip --strip-unneeded" \
"SYSCFLAGS=-DLUA_BUILD_AS_DLL" "SYSLIBS=" "SYSLDFLAGS=-s" lua.exe
- $(MAKE) "LUAC_T=luac.exe" luac.exe
+ $(MAKE) "LUAC_T=luac.exe" "LUA_A=lua54.dll" "LUA_A_LINK=lua54.lib" luac.exe
posix:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX"
--
2.33.0