commit: f7ea0866302d2c79958a99b3f6a85bcd7f58931a
parent 9961c4b75fdd9dfd5f91288076418138c98b38ae
Author: fosslinux <fosslinux@aussies.space>
Date: Wed, 3 Feb 2021 17:03:25 +1100
Add patch headers
Also cleanup the flex patch a bit
Diffstat:
20 files changed, 107 insertions(+), 40 deletions(-)
diff --git a/sysa/bash-2.05b/patches/dev-tty.patch b/sysa/bash-2.05b/patches/dev-tty.patch
@@ -1,3 +1,7 @@
+We do not have /dev at this stage of the bootstrap, including /dev/tty. For
+some reason, bash has a fixation on /dev/tty, even though we are not
+interactive. Removing this check entirely fixes this issue.
+
diff --color -ru shell.c
--- shell.c 2002-07-02 01:27:11.000000000 +1000
+++ shell.c 2021-01-16 11:23:36.407287955 +1100
diff --git a/sysa/bash-2.05b/patches/extern.patch b/sysa/bash-2.05b/patches/extern.patch
@@ -1,4 +1,6 @@
---- builtins/common.c.bak 2021-01-15 21:32:56.938683418 +1100
+tinycc's extern support is bad. i.e. these externs don't propagate through.
+
+--- builtins/common.c 2021-01-15 21:32:56.938683418 +1100
+++ builtins/common.c 2021-01-15 21:34:09.102153806 +1100
@@ -46,6 +46,9 @@
#include "../flags.h"
diff --git a/sysa/bash-2.05b/patches/locale.patch b/sysa/bash-2.05b/patches/locale.patch
@@ -1,3 +1,5 @@
+mes libc + setting locale = not worky.
+
--- locale.c 2021-01-15 09:38:55.729307629 +1100
+++ locale.c 2021-01-15 11:19:01.929391346 +1100
@@ -190,7 +190,7 @@
diff --git a/sysa/bash-2.05b/patches/mes-libc.patch b/sysa/bash-2.05b/patches/mes-libc.patch
@@ -1,3 +1,5 @@
+mes libc does not have locale support...
+
diff --git lib/sh/snprintf.c lib/sh/snprintf.c
index 7669576..747aeba 100644
--- lib/sh/snprintf.c
diff --git a/sysa/bash-2.05b/patches/missing-defines.patch b/sysa/bash-2.05b/patches/missing-defines.patch
@@ -1,4 +1,8 @@
---- ../bash-2.05b.bak/execute_cmd.c 2021-01-15 09:38:55.730307635 +1100
+We don't actually want any of these things, which should really be hidden
+behind the ifdefs given here to disable them when they are not being
+used (as we do).
+
+--- execute_cmd.c 2021-01-15 09:38:55.730307635 +1100
+++ execute_cmd.c 2021-01-15 09:43:41.046896754 +1100
@@ -286,12 +286,18 @@
{
diff --git a/sysa/bash-2.05b/patches/tinycc.patch b/sysa/bash-2.05b/patches/tinycc.patch
@@ -1,3 +1,6 @@
+int name, namelen; is wrong for mes libc, it is char* name, so we modify tinycc
+to reflect this.
+
diff --git lib/sh/oslib.c lib/sh/oslib.c
index 90d7be9..37fdf2a 100644
--- lib/sh/oslib.c
diff --git a/sysa/bzip2-1.0.8/patches/coreutils.patch b/sysa/bzip2-1.0.8/patches/coreutils.patch
@@ -1,4 +1,8 @@
-diff -r -N -U3 bzip2-1.0.8/Makefile bzip2-1.0.8/Makefile
+Disable all coreutils calls in the Makefile which we do not have at this
+point of the bootstrap. ranlib can be unconditionally disabled as we do not
+have it either.
+
+diff -r -N -U3 Makefile Makefile
--- Makefile 2019-07-13 18:50:05.000000000 +0100
+++ Makefile 2021-01-14 15:45:17.558516299 +0000
@@ -21,7 +21,7 @@
diff --git a/sysa/bzip2-1.0.8/patches/mes-libc.patch b/sysa/bzip2-1.0.8/patches/mes-libc.patch
@@ -1,4 +1,9 @@
-diff -r -N -U3 bzip2-1.0.8/bzip2.c bzip2-1.0.8/bzip2.c
+mes libc has no time support, so we remove that.
+
+It also does not have fch{own,mod}, which we don't care about in the bootstrap
+anyway, so we can null-op those calls.
+
+diff -r -N -U3 bzip2.c bzip2.c
--- bzip2.c 2019-07-13 18:50:05.000000000 +0100
+++ bzip2.c 2021-01-14 14:11:40.160213521 +0000
@@ -1051,12 +1051,9 @@
@@ -15,7 +20,7 @@ diff -r -N -U3 bzip2-1.0.8/bzip2.c bzip2-1.0.8/bzip2.c
ERROR_IF_NOT_ZERO ( retVal );
# endif
}
-diff -r -N -U3 bzip2-1.0.8/utime.h bzip2-1.0.8/utime.h
+diff -r -N -U3 utime.h utime.h
--- utime.h 1970-01-01 01:00:00.000000000 +0100
+++ utime.h 2021-01-14 18:11:11.253825037 +0000
@@ -0,0 +1,2 @@
diff --git a/sysa/coreutils-5.0/patches/ls-strcmp.patch b/sysa/coreutils-5.0/patches/ls-strcmp.patch
@@ -1,3 +1,5 @@
+strcoll() does not exist in mes libc, change it to strcmp.
+
--- src/ls.c
+++ src/ls.c
@@ -2597,7 +2597,7 @@ xstrcoll (char const *a, char const *b)
diff --git a/sysa/coreutils-5.0/patches/mbstate.patch b/sysa/coreutils-5.0/patches/mbstate.patch
@@ -1,3 +1,6 @@
+mbstate_t is a struct that is required. However, it is not defined by mes libc.
+This implementation was taken from glibc 2.32.
+
--- lib/quotearg.c 2002-11-23 07:08:10.000000000 +0000
+++ lib/quotearg.c 2021-01-17 19:41:59.461095532 +0000
@@ -21,6 +21,7 @@
diff --git a/sysa/coreutils-5.0/patches/modechange.patch b/sysa/coreutils-5.0/patches/modechange.patch
@@ -1,3 +1,6 @@
+modechange.h uses functions defined in sys/stat.h, so we need to move it to
+after sys/stat.h include.
+
--- lib/modechange.c 2001-12-09 22:54:19.000000000 +0000
+++ lib/modechange.c 2021-01-17 18:34:22.016427148 +0000
@@ -28,8 +28,8 @@
diff --git a/sysa/flex-2.5.11/patches/flexdef.patch b/sysa/flex-2.5.11/patches/flexdef.patch
@@ -1,24 +0,0 @@
-diff --git flexdef.h flexdef.h
-index 3eb710a..94ef024 100644
---- flexdef.h
-+++ flexdef.h
-@@ -421,7 +421,7 @@ extern int yymore_really_used, reject_really_used;
- */
-
- extern int datapos, dataline, linenum, out_linenum;
--extern FILE *skelfile, *yyin, *backing_up_file;
-+extern FILE *skelfile, *backing_up_file;
- extern const char *skel[];
- extern int skel_ind;
- extern char *infilename, *outfilename, *headerfilename;
-@@ -432,6 +432,10 @@ extern char **input_files;
- extern int num_input_files;
- extern char *program_name;
-
-+#ifndef yyin_defined
-+extern FILE* yyin;
-+#endif
-+
- extern char *action_array;
- extern int action_size;
- extern int defs1_offset, prolog_offset, action_offset, action_index;
diff --git a/sysa/flex-2.5.11/patches/scan_l.patch b/sysa/flex-2.5.11/patches/scan_l.patch
@@ -1,15 +1,9 @@
+Comments are unsupported by our flex.
+
diff --git scan.l scan.l
index 18d0de8..c251a5e 100644
--- scan.l
+++ scan.l
-@@ -32,6 +32,7 @@
- /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
- /* PURPOSE. */
-
-+#define yyin_defined
- #include "flexdef.h"
- #include "parse.h"
-
@@ -334,8 +335,8 @@ LEXOPT [aceknopr]
diff --git a/sysa/flex-2.5.11/patches/yyin.patch b/sysa/flex-2.5.11/patches/yyin.patch
@@ -0,0 +1,37 @@
+yyin has an odd redefinition error in scan.l, so we ensure that we don't
+acidentally re-declare it.
+
+diff --git flexdef.h flexdef.h
+index 3eb710a..94ef024 100644
+--- flexdef.h
++++ flexdef.h
+@@ -421,7 +421,7 @@ extern int yymore_really_used, reject_really_used;
+ */
+
+ extern int datapos, dataline, linenum, out_linenum;
+-extern FILE *skelfile, *yyin, *backing_up_file;
++extern FILE *skelfile, *backing_up_file;
+ extern const char *skel[];
+ extern int skel_ind;
+ extern char *infilename, *outfilename, *headerfilename;
+@@ -432,6 +432,10 @@ extern char **input_files;
+ extern int num_input_files;
+ extern char *program_name;
+
++#ifndef yyin_defined
++extern FILE* yyin;
++#endif
++
+ extern char *action_array;
+ extern int action_size;
+ extern int defs1_offset, prolog_offset, action_offset, action_index;
+--- scan.l
++++ scan.l
+@@ -32,6 +32,7 @@
+ /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
+ /* PURPOSE. */
+
++#define yyin_defined
+ #include "flexdef.h"
+ #include "parse.h"
+
diff --git a/sysa/heirloom-devtools-070527/patches/lex_remove_wchar.patch b/sysa/heirloom-devtools-070527/patches/lex_remove_wchar.patch
@@ -3,6 +3,9 @@ From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= <andrius@stikonas.eu>
Date: Wed, 27 Jan 2021 00:40:19 +0000
Subject: [PATCH] Workaround for lex to work with mes libc.
+Similarily to yacc, remove wchar. See yacc patch for further
+information.
+
---
lex/Makefile.mk | 2 +-
lex/allprint.c | 6 ++--
diff --git a/sysa/heirloom-devtools-070527/patches/yacc_remove_wchar.patch b/sysa/heirloom-devtools-070527/patches/yacc_remove_wchar.patch
@@ -1,3 +1,10 @@
+Remove all kinds of wchar support. Mes Libc does not support wchar in any form,
+so we need to remove it.
+
+heirloom-devtools is all kinds of broken in this way. C standard dictates that
+wchar_t may be defined as char, however heirloom-devtools does not respect this,
+which makes this non-trivial.
+
diff -U3 -r yacc/dextern yacc/dextern
--- yacc/dextern 2005-11-10 20:31:45.000000000 +0000
+++ yacc/dextern 2021-01-25 18:21:45.286602527 +0000
diff --git a/sysa/m4-1.4/patches/signal-include.patch b/sysa/m4-1.4/patches/signal-include.patch
@@ -1,4 +1,7 @@
-diff -r -U3 m4-1.4/src/m4.c m4-1.4-patched/src/m4.c
+sys/signal.h is not the POSIX appropriate place for signal.h, which mes libc
+attempts to conform to.
+
+diff -r -U3 src/m4.c src/m4.c
--- src/m4.c 1994-11-02 03:14:28.000000000 +0000
+++ src/m4.c 2021-01-15 00:19:21.947654461 +0000
@@ -19,7 +19,7 @@
diff --git a/sysa/make-3.80/patches/mes-libc.patch b/sysa/make-3.80/patches/mes-libc.patch
@@ -1,4 +1,11 @@
-diff --color -ru make-3.80.bak/job.c make-3.80/job.c
+Two incompatibilities:
+
+* mes libc does not provide string.h
+* lseek is not provided by mes libc
+
+Both of these functions are unused later.
+
+diff --color -ru job.c job.c
--- job.c 2021-01-14 10:26:42.457657979 +1100
+++ job.c 2021-01-14 10:27:03.332776801 +1100
@@ -28,8 +28,6 @@
@@ -10,7 +17,7 @@ diff --color -ru make-3.80.bak/job.c make-3.80/job.c
/* Default shell to use. */
#ifdef WINDOWS32
char *default_shell = "sh.exe";
-diff --color -ru make-3.80.bak/make.h make-3.80/make.h
+diff --color -ru make.h make.h
--- make.h 2021-01-14 10:26:42.456657974 +1100
+++ make.h 2021-01-14 10:26:51.154707480 +1100
@@ -467,9 +467,6 @@
diff --git a/sysa/tcc-0.9.27/patches/mes-libc-qsort.patch b/sysa/tcc-0.9.27/patches/mes-libc-qsort.patch
@@ -1,3 +1,6 @@
+Reimplement qswap in a more correct manner that works much more cleanly and
+with larger string sizes.
+
--- lib/stdlib/qsort.c
+++ lib/stdlib/qsort.c
@@ -1,6 +1,7 @@
diff --git a/sysa/tcc-0.9.27/patches/static-link.patch b/sysa/tcc-0.9.27/patches/static-link.patch
@@ -1,3 +1,6 @@
+static linking is the only typing of linking mes libc supports, so default to
+it.
+
--- libtcc.c 2021-01-14 08:25:30.774995301 +1100
+++ libtcc.c 2021-01-14 08:26:37.594417450 +1100
@@ -734,6 +734,7 @@