pkg/lua: remove unnecessary patch

This commit is contained in:
Alexandre Abadie 2020-06-24 10:19:32 +02:00
parent 48bdd7018a
commit dc2be00c63
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
8 changed files with 21 additions and 379 deletions

View File

@ -1,7 +1,7 @@
From ef0650e050057db5af2e0b4f934f294656c261a7 Mon Sep 17 00:00:00 2001 From bf2559f44dcda7b50871a6f8093b032ccc744226 Mon Sep 17 00:00:00 2001
From: Juan Carrano <j.carrano@fu-berlin.de> From: Juan Carrano <j.carrano@fu-berlin.de>
Date: Tue, 24 Apr 2018 16:38:37 +0200 Date: Tue, 24 Apr 2018 16:38:37 +0200
Subject: [PATCH 1/8] Remove luaL_newstate. Subject: [PATCH 1/7] Remove luaL_newstate.
--- ---
lauxlib.c | 25 ------------------------- lauxlib.c | 25 -------------------------
@ -58,5 +58,5 @@ index 1d65c975..77d1494d 100644
LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p, LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p,
-- --
2.17.1 2.25.1

View File

@ -1,7 +1,7 @@
From 2e86c4b6b7061b69929d601096e3f0a086ffcc81 Mon Sep 17 00:00:00 2001 From 553bb913c4b384e4ab33cee105bfe18bac6f2e5a Mon Sep 17 00:00:00 2001
From: Juan Carrano <j.carrano@fu-berlin.de> From: Juan Carrano <j.carrano@fu-berlin.de>
Date: Thu, 3 May 2018 16:55:05 +0200 Date: Thu, 3 May 2018 16:55:05 +0200
Subject: [PATCH 2/8] Allow LUAL_BUFFERSIZE to be defined in the command line. Subject: [PATCH 2/7] Allow LUAL_BUFFERSIZE to be defined in the command line.
--- ---
luaconf.h | 4 ++++ luaconf.h | 4 ++++
@ -29,5 +29,5 @@ index 118f997a..e816db00 100644
-- --
2.17.1 2.25.1

View File

@ -1,7 +1,7 @@
From bd9e76ed9c9044521537d66fd017a21e98aa53c3 Mon Sep 17 00:00:00 2001 From 1efd759af2cdb13291bba836bcf2775b1dea8924 Mon Sep 17 00:00:00 2001
From: Juan Carrano <j.carrano@fu-berlin.de> From: Juan Carrano <j.carrano@fu-berlin.de>
Date: Mon, 7 May 2018 13:29:15 +0200 Date: Mon, 7 May 2018 13:29:15 +0200
Subject: [PATCH 3/8] Make size of LoadF buffer configurable. Subject: [PATCH 3/7] Make size of LoadF buffer configurable.
--- ---
lauxlib.c | 2 +- lauxlib.c | 2 +-
@ -21,5 +21,5 @@ index 018a4347..8bd2b5af 100644
-- --
2.17.1 2.25.1

View File

@ -1,7 +1,7 @@
From c414df012e8382df3ae078c6dda5554e6c505e31 Mon Sep 17 00:00:00 2001 From 36d7747f18aeb02c317e6ab4dd5542071ad41842 Mon Sep 17 00:00:00 2001
From: Juan Carrano <j.carrano@fu-berlin.de> From: Juan Carrano <j.carrano@fu-berlin.de>
Date: Mon, 7 May 2018 13:59:06 +0200 Date: Mon, 7 May 2018 13:59:06 +0200
Subject: [PATCH 4/8] Remove os.tmpname. Subject: [PATCH 4/7] Remove os.tmpname.
It is a potential source of bugs, causes compiler warnings when building It is a potential source of bugs, causes compiler warnings when building
without POSIX, behaves differently under POSIX, and cannot be fixed. without POSIX, behaves differently under POSIX, and cannot be fixed.
@ -91,5 +91,5 @@ index dd2bb378..69a5f531 100644
}; };
-- --
2.17.1 2.25.1

View File

@ -1,7 +1,7 @@
From 0900faaa14e95b24ad126bb64eebfed60121608b Mon Sep 17 00:00:00 2001 From e8f6c3d34a36a0e9a994d49d2f3ae4c3af18a09a Mon Sep 17 00:00:00 2001
From: Juan Carrano <j.carrano@fu-berlin.de> From: Juan Carrano <j.carrano@fu-berlin.de>
Date: Wed, 9 May 2018 14:05:53 +0200 Date: Wed, 9 May 2018 14:05:53 +0200
Subject: [PATCH 5/8] Do not allocate buffers on the stack. Subject: [PATCH 5/7] Do not allocate buffers on the stack.
Change luaL_Buffer so that the memory for the object is always allocated in the heap. Change luaL_Buffer so that the memory for the object is always allocated in the heap.
--- ---
@ -160,5 +160,5 @@ index 588bf40d..0e50898b 100644
addfield(L, &b, i); addfield(L, &b, i);
luaL_addlstring(&b, sep, lsep); luaL_addlstring(&b, sep, lsep);
-- --
2.17.1 2.25.1

View File

@ -1,7 +1,7 @@
From 542105cafbba381ef40c414a4025ea25d20371a2 Mon Sep 17 00:00:00 2001 From c579b54b04653e07114755d17a3999edceb3843c Mon Sep 17 00:00:00 2001
From: Juan Carrano <j.carrano@fu-berlin.de> From: Juan Carrano <j.carrano@fu-berlin.de>
Date: Mon, 14 May 2018 15:19:14 +0200 Date: Mon, 14 May 2018 15:19:14 +0200
Subject: [PATCH 6/8] Cleanup test module. Subject: [PATCH 6/7] Cleanup test module.
This patch makes several improvements to the test module intended This patch makes several improvements to the test module intended
to allow testing inside embedded environments: to allow testing inside embedded environments:
@ -493,5 +493,5 @@ index fc4e2388..b40f0d5c 100644
/* /*
** RCS ident string ** RCS ident string
-- --
2.17.1 2.25.1

View File

@ -1,358 +0,0 @@
From 1cfceae0d4d4ead217af7b66ed24b3909eb22dd2 Mon Sep 17 00:00:00 2001
From: Juan Carrano <j.carrano@fu-berlin.de>
Date: Mon, 14 May 2018 15:31:09 +0200
Subject: [PATCH 7/8] Add a proper makefile.
The new makefile has automatic dependencies, can buid a debug an
a non debug version simultaneously and is way cleaner.
---
.gitignore | 7 ++
Makefile | 116 +++++++++++++++++++++++++++++++
makefile | 198 -----------------------------------------------------
3 files changed, 123 insertions(+), 198 deletions(-)
create mode 100644 .gitignore
create mode 100644 Makefile
delete mode 100644 makefile
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..08e46c95
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+*.o
+*.gch
+*.d
+*.a
+lua
+lua-dbg
+*.patch
diff --git a/Makefile b/Makefile
new file mode 100644
index 00000000..2735db8d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,116 @@
+
+RM= rm -f
+LD=CC
+ARFLAGS = rcs
+
+CWARNS= \
+ -Wall \
+ -pedantic \
+ -Wextra \
+ -Wshadow \
+ -Wsign-compare \
+ -Wundef \
+ -Wwrite-strings \
+ -Wredundant-decls \
+ -Wdisabled-optimization \
+ -Waggregate-return \
+ -Wdouble-promotion \
+ -Wdeclaration-after-statement \
+ -Wmissing-prototypes \
+ -Wnested-externs \
+ -Wstrict-prototypes \
+ -Wc++-compat \
+ -Wold-style-definition
+ #-Wno-aggressive-loop-optimizations # not accepted by clang \
+ #-Wlogical-op # not accepted by clang \
+ # the next warnings generate too much noise, so they are disabled
+ # -Wconversion -Wno-sign-conversion \
+ # -Wsign-conversion \
+ # -Wconversion \
+ # -Wstrict-overflow=2 \
+ # -Wformat=2 \
+ # -Wcast-qual \
+
+# -DEXTERNMEMCHECK -DHARDSTACKTESTS -DHARDMEMTESTS -DTRACEMEM='"tempmem"'
+# -g -DLUA_USER_H='"ltests.h"'
+# -pg -malign-double
+# -DLUA_USE_CTYPE -DLUA_USE_APICHECK
+# (in clang, '-ftrapv' for runtime checks of integer overflows)
+# -fsanitize=undefined -ftrapv
+TESTFLAGS= -DDEBUG_OVERRIDE_SIZES
+
+OFLAGS?=-O2
+CFLAGS?= -std=c99 $(OFLAGS) $(CWARNS)
+DEPFLAGS= -MM -MP -MQ $@ -MQ $*.o -MQ $*-dbg.o
+LIBS?= -lm -ldl -lreadline
+LDFLAGS?=$(LIBS)
+
+ifeq ($(LUA_32BITS),true)
+CFLAGS+= -DLUA_32BITS
+endif
+
+# rwildcard
+# Use this function to recursively search for all files with a certain
+# extension
+rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
+
+ALL_C_FILES=$(call rwildcard,,*.c)
+C_FILES=$(filter-out lua.c,$(ALL_C_FILES))
+D_FILES=$(call rwildcard,,*.d)
+O_FILES=$(call rwildcard,,*.o)
+GCH_FILES=$(call rwildcard,,*.gch)
+
+NEEDED_OBJECTS=$(C_FILES:.c=.o)
+DBG_OBJECTS=$(C_FILES:.c=-dbg.o)
+
+all: lua liblua.a lua-dbg liblua-dbg.a
+
+# --------------------------- cleaning -------------------------------------- #
+
+.PHONY: clean
+clean: $(foreach f,$(O_FILES),$(f)-clean) \
+ $(foreach f,$(GCH_FILES),$(f)-clean) \
+ liblua.a-clean lua-clean liblua-dbg.a-clean lua-dbg-clean
+
+PHONY: depclean
+depclean: $(foreach dfile,$(D_FILES),$(dfile)-clean)
+
+.PHONY: allclean
+allclean: clean depclean
+
+%-clean:
+ $(RM) $*
+
+# ----------------------------- DEPENDENCIES --------------------------------- #
+
+# If we are only cleaning then ignore the dependencies
+ifneq ($(MAKECMDGOALS),depclean)
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),allclean)
+-include $(C_FILES:.c=.d)
+endif
+endif
+endif
+
+%.d: %.c
+ $(CC) $(CFLAGS) $(DEPFLAGS) $< >$@
+
+# --------------------------- Output targets --------------------------------- #
+
+liblua.a: $(NEEDED_OBJECTS)
+
+liblua-dbg.a: $(DBG_OBJECTS)
+
+lua: lua.o liblua.a
+
+lua-dbg: lua-dbg.o liblua-dbg.a
+
+# --------------------------- Implicit rules --------------------------------- #
+
+%.a:
+ @echo $(MSG_ARCHIVING)
+ $(AR) $(ARFLAGS) $@ $^
+
+%-dbg.o: %.c
+ # Override optimization options
+ $(CC) $(CFLAGS) -O0 -g -dA -DLUA_DEBUG -DDEBUG_OVERRIDE_SIZES -c $< -o $@
diff --git a/makefile b/makefile
deleted file mode 100644
index 8160d4fb..00000000
--- a/makefile
+++ /dev/null
@@ -1,198 +0,0 @@
-# makefile for building Lua
-# see INSTALL for installation instructions
-# see ../Makefile and luaconf.h for further customization
-
-# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
-
-# Warnings valid for both C and C++
-CWARNSCPP= \
- -pedantic \
- -Wextra \
- -Wshadow \
- -Wsign-compare \
- -Wundef \
- -Wwrite-strings \
- -Wredundant-decls \
- -Wdisabled-optimization \
- -Waggregate-return \
- -Wdouble-promotion \
- #-Wno-aggressive-loop-optimizations # not accepted by clang \
- #-Wlogical-op # not accepted by clang \
- # the next warnings generate too much noise, so they are disabled
- # -Wconversion -Wno-sign-conversion \
- # -Wsign-conversion \
- # -Wconversion \
- # -Wstrict-overflow=2 \
- # -Wformat=2 \
- # -Wcast-qual \
-
-# The next warnings are neither valid nor needed for C++
-CWARNSC= -Wdeclaration-after-statement \
- -Wmissing-prototypes \
- -Wnested-externs \
- -Wstrict-prototypes \
- -Wc++-compat \
- -Wold-style-definition \
-
-
-CWARNS= $(CWARNSCPP) $(CWARNSC)
-
-
-# -DEXTERNMEMCHECK -DHARDSTACKTESTS -DHARDMEMTESTS -DTRACEMEM='"tempmem"'
-# -g -DLUA_USER_H='"ltests.h"'
-# -pg -malign-double
-# -DLUA_USE_CTYPE -DLUA_USE_APICHECK
-# (in clang, '-ftrapv' for runtime checks of integer overflows)
-# -fsanitize=undefined -ftrapv
-TESTS= -DLUA_USER_H='"ltests.h"'
-
-# -mtune=native -fomit-frame-pointer
-# -fno-stack-protector
-LOCAL = $(TESTS) $(CWARNS) -g
-
-
-
-# enable Linux goodies
-MYCFLAGS= $(LOCAL) -std=c99 -DLUA_USE_LINUX -DLUA_COMPAT_5_2
-MYLDFLAGS= $(LOCAL) -Wl,-E
-MYLIBS= -ldl -lreadline
-
-
-CC= clang-3.8
-CFLAGS= -Wall -O2 $(MYCFLAGS)
-AR= ar rcu
-RANLIB= ranlib
-RM= rm -f
-
-
-
-# == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
-
-
-LIBS = -lm
-
-CORE_T= liblua.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 ltests.o
-AUX_O= lauxlib.o
-LIB_O= lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o \
- lutf8lib.o lbitlib.o loadlib.o lcorolib.o linit.o
-
-LUA_T= lua
-LUA_O= lua.o
-
-# LUAC_T= luac
-# LUAC_O= luac.o print.o
-
-ALL_T= $(CORE_T) $(LUA_T) $(LUAC_T)
-ALL_O= $(CORE_O) $(LUA_O) $(LUAC_O) $(AUX_O) $(LIB_O)
-ALL_A= $(CORE_T)
-
-all: $(ALL_T)
-
-o: $(ALL_O)
-
-a: $(ALL_A)
-
-$(CORE_T): $(CORE_O) $(AUX_O) $(LIB_O)
- $(AR) $@ $?
- $(RANLIB) $@
-
-$(LUA_T): $(LUA_O) $(CORE_T)
- $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(CORE_T) $(LIBS) $(MYLIBS) $(DL)
-
-$(LUAC_T): $(LUAC_O) $(CORE_T)
- $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(CORE_T) $(LIBS) $(MYLIBS)
-
-clean:
- rcsclean -u
- $(RM) $(ALL_T) $(ALL_O)
-
-depend:
- @$(CC) $(CFLAGS) -MM *.c
-
-echo:
- @echo "CC = $(CC)"
- @echo "CFLAGS = $(CFLAGS)"
- @echo "AR = $(AR)"
- @echo "RANLIB = $(RANLIB)"
- @echo "RM = $(RM)"
- @echo "MYCFLAGS = $(MYCFLAGS)"
- @echo "MYLDFLAGS = $(MYLDFLAGS)"
- @echo "MYLIBS = $(MYLIBS)"
- @echo "DL = $(DL)"
-
-$(ALL_O): makefile
-
-# DO NOT EDIT
-# automatically made with 'gcc -MM l*.c'
-
-lapi.o: lapi.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \
- lobject.h ltm.h lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h lstring.h \
- ltable.h lundump.h lvm.h
-lauxlib.o: lauxlib.c lprefix.h lua.h luaconf.h lauxlib.h
-lbaselib.o: lbaselib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
-lbitlib.o: lbitlib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
-lcode.o: lcode.c lprefix.h lua.h luaconf.h lcode.h llex.h lobject.h \
- llimits.h lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h \
- ldo.h lgc.h lstring.h ltable.h lvm.h
-lcorolib.o: lcorolib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
-lctype.o: lctype.c lprefix.h lctype.h lua.h luaconf.h llimits.h
-ldblib.o: ldblib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
-ldebug.o: ldebug.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \
- lobject.h ltm.h lzio.h lmem.h lcode.h llex.h lopcodes.h lparser.h \
- ldebug.h ldo.h lfunc.h lstring.h lgc.h ltable.h lvm.h
-ldo.o: ldo.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \
- lobject.h ltm.h lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h lopcodes.h \
- lparser.h lstring.h ltable.h lundump.h lvm.h
-ldump.o: ldump.c lprefix.h lua.h luaconf.h lobject.h llimits.h lstate.h \
- ltm.h lzio.h lmem.h lundump.h
-lfunc.o: lfunc.c lprefix.h lua.h luaconf.h lfunc.h lobject.h llimits.h \
- lgc.h lstate.h ltm.h lzio.h lmem.h
-lgc.o: lgc.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
- llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h
-linit.o: linit.c lprefix.h lua.h luaconf.h lualib.h lauxlib.h
-liolib.o: liolib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
-llex.o: llex.c lprefix.h lua.h luaconf.h lctype.h llimits.h ldebug.h \
- lstate.h lobject.h ltm.h lzio.h lmem.h ldo.h lgc.h llex.h lparser.h \
- lstring.h ltable.h
-lmathlib.o: lmathlib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
-lmem.o: lmem.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
- llimits.h ltm.h lzio.h lmem.h ldo.h lgc.h
-loadlib.o: loadlib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
-lobject.o: lobject.c lprefix.h lua.h luaconf.h lctype.h llimits.h \
- ldebug.h lstate.h lobject.h ltm.h lzio.h lmem.h ldo.h lstring.h lgc.h \
- lvm.h
-lopcodes.o: lopcodes.c lprefix.h lopcodes.h llimits.h lua.h luaconf.h
-loslib.o: loslib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
-lparser.o: lparser.c lprefix.h lua.h luaconf.h lcode.h llex.h lobject.h \
- llimits.h lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h \
- ldo.h lfunc.h lstring.h lgc.h ltable.h
-lstate.o: lstate.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \
- lobject.h ltm.h lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h llex.h \
- lstring.h ltable.h
-lstring.o: lstring.c lprefix.h lua.h luaconf.h ldebug.h lstate.h \
- lobject.h llimits.h ltm.h lzio.h lmem.h ldo.h lstring.h lgc.h
-lstrlib.o: lstrlib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
-ltable.o: ltable.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
- llimits.h ltm.h lzio.h lmem.h ldo.h lgc.h lstring.h ltable.h lvm.h
-ltablib.o: ltablib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
-ltests.o: ltests.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \
- lobject.h ltm.h lzio.h lmem.h lauxlib.h lcode.h llex.h lopcodes.h \
- lparser.h lctype.h ldebug.h ldo.h lfunc.h lstring.h lgc.h ltable.h \
- lualib.h
-ltm.o: ltm.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
- llimits.h ltm.h lzio.h lmem.h ldo.h lstring.h lgc.h ltable.h lvm.h
-lua.o: lua.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
-lundump.o: lundump.c lprefix.h lua.h luaconf.h ldebug.h lstate.h \
- lobject.h llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lstring.h lgc.h \
- lundump.h
-lutf8lib.o: lutf8lib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
-lvm.o: lvm.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
- llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h lopcodes.h lstring.h \
- ltable.h lvm.h
-lzio.o: lzio.c lprefix.h lua.h luaconf.h llimits.h lmem.h lstate.h \
- lobject.h ltm.h lzio.h
-
-# (end of Makefile)
--
2.17.1

View File

@ -1,7 +1,7 @@
From a3bb3e20c12dd7436fe4c3ec4c4f09b98ed0c443 Mon Sep 17 00:00:00 2001 From 152314d1e706046575a70f339e913d2d8dfdab7f Mon Sep 17 00:00:00 2001
From: Juan Carrano <j.carrano@fu-berlin.de> From: Juan Carrano <j.carrano@fu-berlin.de>
Date: Tue, 29 May 2018 11:55:49 +0200 Date: Tue, 29 May 2018 11:55:49 +0200
Subject: [PATCH 8/8] Default to 32 bit build and small buffer size. Subject: [PATCH 7/7] Default to 32 bit build and small buffer size.
Set the word length and buffer size in luaconf.h so that it doesn't have to Set the word length and buffer size in luaconf.h so that it doesn't have to
be specified in the compiler's command line each time. be specified in the compiler's command line each time.
@ -37,5 +37,5 @@ index e816db00..8093833d 100644
#endif #endif
-- --
2.17.1 2.25.1