0
0
mirror of https://github.com/openwrt/packages.git synced 2025-07-08 11:25:28 +00:00
Files
packages/lang/lua5.4/patches/020-shared_liblua.patch
Jianhui Zhao 769e8f9d2d lua: lua5.4 update to 5.4.7
1ab3208a1fceb12fca8f24ba57d6e13c5bff15e3 'lua.h' back to redundancy in version definitions
21ff8de33a5aca9c3c907592b894e4b9ab036d3e Bug: Tricky _PROMPT may trigger undefined behavior
7eb1ed21b7057ab5f1b921f8271eddcf13659737 More permissive use of 'errno'
2db966fcbf757775c842bc66449d7e697826aa1d Bug: luaL_traceback may need more than 5 stack slots
ae9a0cbbb446499e759acae47664d1d136d7ba90 Bug: overlapping assignments
d5212c13b081ed62d8e1ae436779e79c79edf564 More disciplined use of 'errno'
e0efebdbe4e4053c6fb78588c546f1dc23aa964a Detail in the manual
e84f7bf19852c35ad0a1e9a1654a7b99a211e17c Details
dfbde4c7d540f81f2cc539741a2c1f4c00f91c10 Bug: Active-lines for stripped vararg functions
de794a6527058e75b674118b35f39dcbb13e88b1 Towards release 5.4.7
8b83417de982d068bd92e0428a42ca0cdd909789 Avoids a warning when lua_Number is 'float'
e288c5a91883793d14ed9e9d93464f6ee0b08915 Bug: Yielding in a hook stops in the wrong instruction
5853c37a83ec66ccb45094f9aeac23dfdbcde671 Bug: Buffer overflow in string concatenation
842a83f09caa2ebd4bc03e0076420148ac07c808 Panic functions should not raise errors
7923dbbf72da303ca1cca17efd24725668992f15 Bug: Recursion in 'getobjname' can stack overflow
81e4fce5303fdb274bc5572fb168dd766fb8208e Simpler test in 'luaH_getint'
6baee9ef9d5657ab582c8a4b9f885ec58ed502d0 Removed test for "corrupted binary dump"
edd8589f478e784bb8d1a8e9a3bb2bb3ca51738c Avoid casts from unsigned long to floating-point
07a9eab23ac073362f231ddc7215688cf221ff45 Cannot use 'getshrstr' before setting 'shrlen'
9363a8b9901a5643c9da061ea8dda8a86cdc7ef1 Documentation for "LUA_NOENV"
5ab6a5756b3c50c99f1388885e9a48a7da8cbe2d Bug: Wrong line number for function calls
9b4f39ab14fb2e55345c3d23537d129dac23b091 More disciplined use of 'getstr' and 'tsslen'
f4211a5ea4e235ccfa8b8dfa46031c23e9e839e2 More control over encoding of test files
1b3f507f620d996ffb69da7476a19251acfb89ca Bug: Call hook may be called twice when count hook yields
6b51133a988587f34ee9581d799ea9913581afd3 Thread stacks resized in the atomic phase
cbae01620278f9b568805db16a96d0631ced473d Details
ea39042e13645f63713425c05cc9ee4cfdcf0a40 Removed redundancy in definitions of version/release
05ec55f16b389a4377adab84efe374437da8dbd2 Avoid inclusion loop in 'ltm.h'
f623b969325be736297bc1dff48e763c08778243 Bug: read overflow in 'l_strcmp'
9be74ccc214eb6f4d9d0b9496fd973542c7377d9 Several functions turned 'static'
09f3c2372f5dbeaec9f50614a26c1b5761726a88 Option '-l' discards version sufix from file name
c197885cb00b85251c35cffdc4057efaee2d7a88 Small improvements in tests
934e77a286aeb97ca02badf56956ccc78217e9d0 Details

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-04-24 19:39:58 +08:00

116 lines
3.8 KiB
Diff

--- a/Makefile
+++ b/Makefile
@@ -41,7 +41,7 @@ PLATS= guess aix bsd c89 freebsd generic
# What to install.
TO_BIN= lua$V luac$V
TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
-TO_LIB= liblua$V.a
+TO_LIB= liblua$V.a liblua$V.so.0.0.0
TO_MAN= lua$V.1 luac$V.1
# Lua version and release.
@@ -59,6 +59,9 @@ install: dummy
cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
+ ln -s liblua$V.so.0.0.0 $(INSTALL_LIB)/liblua$V.so.0.0
+ ln -s liblua$V.so.0.0.0 $(INSTALL_LIB)/liblua$V.so.0
+ ln -s liblua$V.so.0.0.0 $(INSTALL_LIB)/liblua$V.so
cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
uninstall:
--- a/src/ldebug.h
+++ b/src/ldebug.h
@@ -36,7 +36,7 @@
#endif
-LUAI_FUNC int luaG_getfuncline (const Proto *f, int pc);
+LUA_API int luaG_getfuncline (const Proto *f, int pc);
LUAI_FUNC const char *luaG_findlocal (lua_State *L, CallInfo *ci, int n,
StkId *pos);
LUAI_FUNC l_noret luaG_typeerror (lua_State *L, const TValue *o,
--- a/src/lstring.h
+++ b/src/lstring.h
@@ -50,7 +50,7 @@ LUAI_FUNC void luaS_init (lua_State *L);
LUAI_FUNC void luaS_remove (lua_State *L, TString *ts);
LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, int nuvalue);
LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
-LUAI_FUNC TString *luaS_new (lua_State *L, const char *str);
+LUA_API TString *luaS_new (lua_State *L, const char *str);
LUAI_FUNC TString *luaS_createlngstrobj (lua_State *L, size_t l);
--- a/src/lundump.h
+++ b/src/lundump.h
@@ -29,7 +29,7 @@
LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, const char* name);
/* dump one chunk; from ldump.c */
-LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w,
+LUA_API int luaU_dump (lua_State* L, const Proto* f, lua_Writer w,
void* data, int strip);
#endif
--- a/src/lzio.h
+++ b/src/lzio.h
@@ -44,7 +44,7 @@ typedef struct Mbuffer {
#define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0)
-LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader,
+LUA_API void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader,
void *data);
LUAI_FUNC size_t luaZ_read (ZIO* z, void *b, size_t n); /* read next n bytes */
--- a/src/Makefile
+++ b/src/Makefile
@@ -33,6 +33,7 @@ CMCFLAGS=
PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris
LUA_A= liblua$V.a
+LUA_SO= liblua$V.so.0.0.0
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)
@@ -44,8 +45,9 @@ LUAC_T= luac$V
LUAC_O= luac.o
ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
+ALL_T= $(LUA_A) $(LUA_SO) $(LUA_T) $(LUAC_T)
ALL_A= $(LUA_A)
+ALL_SO= $(LUA_SO)
# Targets start here.
default: $(PLAT)
@@ -56,14 +58,25 @@ o: $(ALL_O)
a: $(ALL_A)
+so: $(ALL_SO)
+
$(LUA_A): $(BASE_O)
$(AR) $@ $(BASE_O)
$(RANLIB) $@
-$(LUA_T): $(LUA_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+$(LUA_SO): $(CORE_O) $(LIB_O)
+ $(CC) -o $@ -Wl,-Bsymbolic-functions -shared -Wl,-soname="$@" $?
+ ln -fs $@ liblua$V.so.0.0
+ ln -fs $@ liblua$V.so.0
+ ln -fs $@ liblua$V.so
+
+$(LUA_T): $(LUA_O) $(LUA_SO)
+ $(CC) -o $@ -L. -llua$V $(MYLDFLAGS) $(LUA_O) $(LIBS)
+
+$(LUAC_T): $(LUAC_O) $(LUA_SO)
+ $(CC) -o $@ -L. -llua$V $(MYLDFLAGS) $(LUAC_O) $(LIBS)
-$(LUAC_T): $(LUAC_O) $(LUA_A)
+$(LUAC_T)-host: $(LUAC_O) $(LUA_A)
$(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
test: