From: Peter Korsgaard Date: Sun, 11 Oct 2020 12:37:58 +0000 (+0200) Subject: package/bash: update to patch level 18 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d73ec6e0ab40675604d735536f67d43b967cb529;p=buildroot.git package/bash: update to patch level 18 Fixes a regression introduced in patch level 16. Rename the 2 uClibc patches so the upstream patch numbering matches ours. Signed-off-by: Peter Korsgaard --- diff --git a/package/bash/0017-bash50-017.patch b/package/bash/0017-bash50-017.patch new file mode 100644 index 0000000000..6758b203f8 --- /dev/null +++ b/package/bash/0017-bash50-017.patch @@ -0,0 +1,293 @@ +From https://ftp.gnu.org/gnu/bash/bash-5.0-patches/bash55-017 + +Signed-off-by: Peter Korsgaard + + BASH PATCH REPORT + ================= + +Bash-Release: 5.0 +Patch-ID: bash50-017 + +Bug-Reported-by: Valentin Lab +Bug-Reference-ID: +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2020-03/msg00062.html + +Bug-Description: + +There were cases where patch 16 reaped process substitution file descriptors +(or FIFOs) and processes to early. This is a better fix for the problem that +bash50-016 attempted to solve. + +Patch (apply with `patch -p0'): + +*** bash-5.0-patched/subst.c 2019-08-29 11:16:49.000000000 -0400 +--- b/subst.c 2020-04-02 16:24:19.000000000 -0400 +*************** +*** 5337,5341 **** + } + +! char * + copy_fifo_list (sizep) + int *sizep; +--- b/5337,5341 ---- + } + +! void * + copy_fifo_list (sizep) + int *sizep; +*************** +*** 5343,5347 **** + if (sizep) + *sizep = 0; +! return (char *)NULL; + } + +--- b/5343,5347 ---- + if (sizep) + *sizep = 0; +! return (void *)NULL; + } + +*************** +*** 5409,5414 **** + if (fifo_list[i].file) + { +! fifo_list[j].file = fifo_list[i].file; +! fifo_list[j].proc = fifo_list[i].proc; + j++; + } +--- b/5409,5419 ---- + if (fifo_list[i].file) + { +! if (i != j) +! { +! fifo_list[j].file = fifo_list[i].file; +! fifo_list[j].proc = fifo_list[i].proc; +! fifo_list[i].file = (char *)NULL; +! fifo_list[i].proc = 0; +! } + j++; + } +*************** +*** 5426,5433 **** + void + close_new_fifos (list, lsize) +! char *list; + int lsize; + { + int i; + + if (list == 0) +--- b/5431,5439 ---- + void + close_new_fifos (list, lsize) +! void *list; + int lsize; + { + int i; ++ char *plist; + + if (list == 0) +*************** +*** 5437,5442 **** + } + +! for (i = 0; i < lsize; i++) +! if (list[i] == 0 && i < fifo_list_size && fifo_list[i].proc != -1) + unlink_fifo (i); + +--- b/5443,5448 ---- + } + +! for (plist = (char *)list, i = 0; i < lsize; i++) +! if (plist[i] == 0 && i < fifo_list_size && fifo_list[i].proc != -1) + unlink_fifo (i); + +*************** +*** 5560,5568 **** + } + +! char * + copy_fifo_list (sizep) + int *sizep; + { +! char *ret; + + if (nfds == 0 || totfds == 0) +--- b/5566,5574 ---- + } + +! void * + copy_fifo_list (sizep) + int *sizep; + { +! void *ret; + + if (nfds == 0 || totfds == 0) +*************** +*** 5570,5579 **** + if (sizep) + *sizep = 0; +! return (char *)NULL; + } + + if (sizep) + *sizep = totfds; +! ret = (char *)xmalloc (totfds * sizeof (pid_t)); + return (memcpy (ret, dev_fd_list, totfds * sizeof (pid_t))); + } +--- b/5576,5585 ---- + if (sizep) + *sizep = 0; +! return (void *)NULL; + } + + if (sizep) + *sizep = totfds; +! ret = xmalloc (totfds * sizeof (pid_t)); + return (memcpy (ret, dev_fd_list, totfds * sizeof (pid_t))); + } +*************** +*** 5648,5655 **** + void + close_new_fifos (list, lsize) +! char *list; + int lsize; + { + int i; + + if (list == 0) +--- b/5654,5662 ---- + void + close_new_fifos (list, lsize) +! void *list; + int lsize; + { + int i; ++ pid_t *plist; + + if (list == 0) +*************** +*** 5659,5664 **** + } + +! for (i = 0; i < lsize; i++) +! if (list[i] == 0 && i < totfds && dev_fd_list[i]) + unlink_fifo (i); + +--- b/5666,5671 ---- + } + +! for (plist = (pid_t *)list, i = 0; i < lsize; i++) +! if (plist[i] == 0 && i < totfds && dev_fd_list[i]) + unlink_fifo (i); + +*** bash-5.0-patched/subst.h 2018-10-21 18:46:09.000000000 -0400 +--- b/subst.h 2020-04-02 16:29:28.000000000 -0400 +*************** +*** 274,280 **** + extern void unlink_fifo __P((int)); + +! extern char *copy_fifo_list __P((int *)); +! extern void unlink_new_fifos __P((char *, int)); +! extern void close_new_fifos __P((char *, int)); + + extern void clear_fifo_list __P((void)); +--- b/274,279 ---- + extern void unlink_fifo __P((int)); + +! extern void *copy_fifo_list __P((int *)); +! extern void close_new_fifos __P((void *, int)); + + extern void clear_fifo_list __P((void)); +*** bash-5.0-patched/execute_cmd.c 2020-02-06 20:16:48.000000000 -0500 +--- b/execute_cmd.c 2020-04-02 17:00:10.000000000 -0400 +*************** +*** 565,569 **** + #if defined (PROCESS_SUBSTITUTION) + volatile int ofifo, nfifo, osize, saved_fifo; +! volatile char *ofifo_list; + #endif + +--- b/565,569 ---- + #if defined (PROCESS_SUBSTITUTION) + volatile int ofifo, nfifo, osize, saved_fifo; +! volatile void *ofifo_list; + #endif + +*************** +*** 751,760 **** + # endif + +! if (variable_context != 0) /* XXX - also if sourcelevel != 0? */ + { + ofifo = num_fifos (); + ofifo_list = copy_fifo_list ((int *)&osize); + begin_unwind_frame ("internal_fifos"); +! add_unwind_protect (xfree, ofifo_list); + saved_fifo = 1; + } +--- b/751,762 ---- + # endif + +! /* XXX - also if sourcelevel != 0? */ +! if (variable_context != 0) + { + ofifo = num_fifos (); + ofifo_list = copy_fifo_list ((int *)&osize); + begin_unwind_frame ("internal_fifos"); +! if (ofifo_list) +! add_unwind_protect (xfree, ofifo_list); + saved_fifo = 1; + } +*************** +*** 1100,1123 **** + nfifo = num_fifos (); + if (nfifo > ofifo) +! close_new_fifos ((char *)ofifo_list, osize); + free ((void *)ofifo_list); + discard_unwind_frame ("internal_fifos"); + } +- # if defined (HAVE_DEV_FD) +- /* Reap process substitutions at the end of loops */ +- switch (command->type) +- { +- case cm_while: +- case cm_until: +- case cm_for: +- case cm_group: +- # if defined (ARITH_FOR_COMMAND) +- case cm_arith_for: +- # endif +- reap_procsubs (); +- default: +- break; +- } +- # endif /* HAVE_DEV_FD */ + #endif + +--- b/1102,1109 ---- + nfifo = num_fifos (); + if (nfifo > ofifo) +! close_new_fifos ((void *)ofifo_list, osize); + free ((void *)ofifo_list); + discard_unwind_frame ("internal_fifos"); + } + #endif + + +*** bash-5.0/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- b/patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 16 + + #endif /* _PATCHLEVEL_H_ */ +--- b/26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 17 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/package/bash/0017-input.h-add-missing-include-on-stdio.h.patch b/package/bash/0017-input.h-add-missing-include-on-stdio.h.patch deleted file mode 100644 index fd008e9472..0000000000 --- a/package/bash/0017-input.h-add-missing-include-on-stdio.h.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 4fa85c85b9a76afd3b19ed75bf17ccd2940f1f55 Mon Sep 17 00:00:00 2001 -From: Fabrice Fontaine -Date: Sun, 16 Feb 2020 16:18:48 +0100 -Subject: [PATCH] input.h: add missing include on stdio.h - -This will fix the following build failure on uclibc: - -test -n "/usr/lfs/hdd_v1/rc-buildroot-test/scripts/instance-2/output/host/bin/arm-linux-ranlib" && /usr/lfs/hdd_v1/rc-buildroot-test/scripts/instance-2/output/host/bin/arm-linux-ranlib libsh.a -In file included from ./exec.def:71: -../input.h:76:3: error: unknown type name 'FILE' - FILE *file; - ^~~~ - -Fixes: - - http://autobuild.buildroot.org/results/bfca306868df54c567215c45c8cdac838d02f567 - -Signed-off-by: Fabrice Fontaine -[Upstream status: https://savannah.gnu.org/support/?110196] ---- - input.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/input.h b/input.h -index 6aef1269..08b0fdea 100644 ---- a/input.h -+++ b/input.h -@@ -21,6 +21,8 @@ - #if !defined (_INPUT_H_) - #define _INPUT_H_ - -+#include -+ - #include "stdc.h" - - /* Function pointers can be declared as (Function *)foo. */ --- -2.24.1 - diff --git a/package/bash/0018-bash50-018.patch b/package/bash/0018-bash50-018.patch new file mode 100644 index 0000000000..efecb1897d --- /dev/null +++ b/package/bash/0018-bash50-018.patch @@ -0,0 +1,49 @@ +From https://ftp.gnu.org/gnu/bash/bash-5.0-patches/bash55-018 + +Signed-off-by: Peter Korsgaard + + BASH PATCH REPORT + ================= + +Bash-Release: 5.0 +Patch-ID: bash50-018 + +Bug-Reported-by: oguzismailuysal@gmail.com +Bug-Reference-ID: +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2019-10/msg00098.html + +Bug-Description: + +In certain cases, bash does not perform quoted null removal on patterns +that are used as part of word expansions such as ${parameter##pattern}, so +empty patterns are treated as non-empty. + +Patch (apply with `patch -p0'): + +*** bash-5.0.17/subst.c 2020-04-02 17:14:58.000000000 -0400 +--- b/subst.c 2020-07-09 15:28:19.000000000 -0400 +*************** +*** 5113,5116 **** +--- b/5113,5118 ---- + (int *)NULL, (int *)NULL) + : (WORD_LIST *)0; ++ if (l) ++ word_list_remove_quoted_nulls (l); + pat = string_list (l); + dispose_words (l); + +*** bash-5.0/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- b/patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 17 + + #endif /* _PATCHLEVEL_H_ */ +--- b/26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 18 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/package/bash/0018-locale.c-fix-build-without-wchar.patch b/package/bash/0018-locale.c-fix-build-without-wchar.patch deleted file mode 100644 index 15c5f2e401..0000000000 --- a/package/bash/0018-locale.c-fix-build-without-wchar.patch +++ /dev/null @@ -1,84 +0,0 @@ -From 73ca494c60d46103f806325e6ccbe9e400238008 Mon Sep 17 00:00:00 2001 -From: Fabrice Fontaine -Date: Sun, 23 Feb 2020 11:41:09 +0100 -Subject: [PATCH] locale.c: fix build without wchar - -bash unconditionally builds locale.c which depends on mblen since -version 5.0 and -https://github.com/bminor/bash/commit/d233b485e83c3a784b803fb894280773f16f2deb - -This results in the following build failure if wchar is not available: - -/home/buildroot/autobuild/run/instance-0/output-1/host/bin/microblazeel-buildroot-linux-uclibc-gcc -L./builtins -L/home/buildroot/autobuild/run/instance-0/output-1/host/microblazeel-buildroot-linux-uclibc/sysroot/lib -L/home/buildroot/autobuild/run/instance-0/output-1/host/microblazeel-buildroot-linux-uclibc/sysroot/lib -L./lib/glob -L./lib/tilde -L./lib/sh -rdynamic -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -Wno-parentheses -Wno-format-security -o bash shell.o eval.o y.tab.o general.o make_cmd.o print_cmd.o dispose_cmd.o execute_cmd.o variables.o copy_cmd.o error.o expr.o flags.o jobs.o subst.o hashcmd.o hashlib.o mailcheck.o trap.o input.o unwind_prot.o pathexp.o sig.o test.o version.o alias.o array.o arrayfunc.o assoc.o braces.o bracecomp.o bashhist.o bashline.o list.o stringlib.o locale.o findcmd.o redir.o pcomplete.o pcomplib.o syntax.o xmalloc.o signames.o -lbuiltins -lglob -lsh -lreadline -lhistory -lcurses -ltilde -ldl -/home/buildroot/autobuild/run/instance-0/output-1/host/lib/gcc/microblazeel-buildroot-linux-uclibc/8.3.0/../../../../microblazeel-buildroot-linux-uclibc/bin/ld: locale.o: in function `set_default_locale': -(.text+0x260): undefined reference to `mblen' - -To fix this issue, don't use mblen if HANDLE_MULTIBYTE is not defined, -an other possibility would be to use MBLEN wrapper defined in shmbutil.h - -Fixes: - - http://autobuild.buildroot.org/results/298fb9c785e137bff432dd304eb56986e54ce3ed - -Signed-off-by: Fabrice Fontaine -[Upstream status: https://savannah.gnu.org/support/index.php?110200] ---- - locale.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/locale.c b/locale.c -index d62547f6..a64c5b4b 100644 ---- a/locale.c -+++ b/locale.c -@@ -86,7 +86,9 @@ set_default_locale () - - locale_mb_cur_max = MB_CUR_MAX; - locale_utf8locale = locale_isutf8 (default_locale); -+#if defined (HANDLE_MULTIBYTE) - locale_shiftstates = mblen ((char *)NULL, 0); -+#endif - } - - /* Set default values for LC_CTYPE, LC_COLLATE, LC_MESSAGES, LC_NUMERIC and -@@ -107,7 +109,9 @@ set_default_locale_vars () - locale_setblanks (); - locale_mb_cur_max = MB_CUR_MAX; - locale_utf8locale = locale_isutf8 (lc_all); -+# if defined (HANDLE_MULTIBYTE) - locale_shiftstates = mblen ((char *)NULL, 0); -+# endif - u32reset (); - } - # endif -@@ -211,7 +215,9 @@ set_locale_var (var, value) - /* if LC_ALL == "", reset_locale_vars has already called this */ - if (*lc_all && x) - locale_utf8locale = locale_isutf8 (lc_all); -+# if defined (HANDLE_MULTIBYTE) - locale_shiftstates = mblen ((char *)NULL, 0); -+# endif - u32reset (); - return r; - #else -@@ -231,7 +237,9 @@ set_locale_var (var, value) - /* if setlocale() returns NULL, the locale is not changed */ - if (x) - locale_utf8locale = locale_isutf8 (x); -+# if defined (HANDLE_MULTIBYTE) - locale_shiftstates = mblen ((char *)NULL, 0); -+# endif - u32reset (); - } - # endif -@@ -368,7 +376,9 @@ reset_locale_vars () - locale_mb_cur_max = MB_CUR_MAX; - if (x) - locale_utf8locale = locale_isutf8 (x); -+# if defined (HANDLE_MULTIBYTE) - locale_shiftstates = mblen ((char *)NULL, 0); -+# endif - u32reset (); - #endif - return 1; --- -2.25.0 - diff --git a/package/bash/0019-input.h-add-missing-include-on-stdio.h.patch b/package/bash/0019-input.h-add-missing-include-on-stdio.h.patch new file mode 100644 index 0000000000..fd008e9472 --- /dev/null +++ b/package/bash/0019-input.h-add-missing-include-on-stdio.h.patch @@ -0,0 +1,38 @@ +From 4fa85c85b9a76afd3b19ed75bf17ccd2940f1f55 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Sun, 16 Feb 2020 16:18:48 +0100 +Subject: [PATCH] input.h: add missing include on stdio.h + +This will fix the following build failure on uclibc: + +test -n "/usr/lfs/hdd_v1/rc-buildroot-test/scripts/instance-2/output/host/bin/arm-linux-ranlib" && /usr/lfs/hdd_v1/rc-buildroot-test/scripts/instance-2/output/host/bin/arm-linux-ranlib libsh.a +In file included from ./exec.def:71: +../input.h:76:3: error: unknown type name 'FILE' + FILE *file; + ^~~~ + +Fixes: + - http://autobuild.buildroot.org/results/bfca306868df54c567215c45c8cdac838d02f567 + +Signed-off-by: Fabrice Fontaine +[Upstream status: https://savannah.gnu.org/support/?110196] +--- + input.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/input.h b/input.h +index 6aef1269..08b0fdea 100644 +--- a/input.h ++++ b/input.h +@@ -21,6 +21,8 @@ + #if !defined (_INPUT_H_) + #define _INPUT_H_ + ++#include ++ + #include "stdc.h" + + /* Function pointers can be declared as (Function *)foo. */ +-- +2.24.1 + diff --git a/package/bash/0020-locale.c-fix-build-without-wchar.patch b/package/bash/0020-locale.c-fix-build-without-wchar.patch new file mode 100644 index 0000000000..15c5f2e401 --- /dev/null +++ b/package/bash/0020-locale.c-fix-build-without-wchar.patch @@ -0,0 +1,84 @@ +From 73ca494c60d46103f806325e6ccbe9e400238008 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Sun, 23 Feb 2020 11:41:09 +0100 +Subject: [PATCH] locale.c: fix build without wchar + +bash unconditionally builds locale.c which depends on mblen since +version 5.0 and +https://github.com/bminor/bash/commit/d233b485e83c3a784b803fb894280773f16f2deb + +This results in the following build failure if wchar is not available: + +/home/buildroot/autobuild/run/instance-0/output-1/host/bin/microblazeel-buildroot-linux-uclibc-gcc -L./builtins -L/home/buildroot/autobuild/run/instance-0/output-1/host/microblazeel-buildroot-linux-uclibc/sysroot/lib -L/home/buildroot/autobuild/run/instance-0/output-1/host/microblazeel-buildroot-linux-uclibc/sysroot/lib -L./lib/glob -L./lib/tilde -L./lib/sh -rdynamic -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -Wno-parentheses -Wno-format-security -o bash shell.o eval.o y.tab.o general.o make_cmd.o print_cmd.o dispose_cmd.o execute_cmd.o variables.o copy_cmd.o error.o expr.o flags.o jobs.o subst.o hashcmd.o hashlib.o mailcheck.o trap.o input.o unwind_prot.o pathexp.o sig.o test.o version.o alias.o array.o arrayfunc.o assoc.o braces.o bracecomp.o bashhist.o bashline.o list.o stringlib.o locale.o findcmd.o redir.o pcomplete.o pcomplib.o syntax.o xmalloc.o signames.o -lbuiltins -lglob -lsh -lreadline -lhistory -lcurses -ltilde -ldl +/home/buildroot/autobuild/run/instance-0/output-1/host/lib/gcc/microblazeel-buildroot-linux-uclibc/8.3.0/../../../../microblazeel-buildroot-linux-uclibc/bin/ld: locale.o: in function `set_default_locale': +(.text+0x260): undefined reference to `mblen' + +To fix this issue, don't use mblen if HANDLE_MULTIBYTE is not defined, +an other possibility would be to use MBLEN wrapper defined in shmbutil.h + +Fixes: + - http://autobuild.buildroot.org/results/298fb9c785e137bff432dd304eb56986e54ce3ed + +Signed-off-by: Fabrice Fontaine +[Upstream status: https://savannah.gnu.org/support/index.php?110200] +--- + locale.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/locale.c b/locale.c +index d62547f6..a64c5b4b 100644 +--- a/locale.c ++++ b/locale.c +@@ -86,7 +86,9 @@ set_default_locale () + + locale_mb_cur_max = MB_CUR_MAX; + locale_utf8locale = locale_isutf8 (default_locale); ++#if defined (HANDLE_MULTIBYTE) + locale_shiftstates = mblen ((char *)NULL, 0); ++#endif + } + + /* Set default values for LC_CTYPE, LC_COLLATE, LC_MESSAGES, LC_NUMERIC and +@@ -107,7 +109,9 @@ set_default_locale_vars () + locale_setblanks (); + locale_mb_cur_max = MB_CUR_MAX; + locale_utf8locale = locale_isutf8 (lc_all); ++# if defined (HANDLE_MULTIBYTE) + locale_shiftstates = mblen ((char *)NULL, 0); ++# endif + u32reset (); + } + # endif +@@ -211,7 +215,9 @@ set_locale_var (var, value) + /* if LC_ALL == "", reset_locale_vars has already called this */ + if (*lc_all && x) + locale_utf8locale = locale_isutf8 (lc_all); ++# if defined (HANDLE_MULTIBYTE) + locale_shiftstates = mblen ((char *)NULL, 0); ++# endif + u32reset (); + return r; + #else +@@ -231,7 +237,9 @@ set_locale_var (var, value) + /* if setlocale() returns NULL, the locale is not changed */ + if (x) + locale_utf8locale = locale_isutf8 (x); ++# if defined (HANDLE_MULTIBYTE) + locale_shiftstates = mblen ((char *)NULL, 0); ++# endif + u32reset (); + } + # endif +@@ -368,7 +376,9 @@ reset_locale_vars () + locale_mb_cur_max = MB_CUR_MAX; + if (x) + locale_utf8locale = locale_isutf8 (x); ++# if defined (HANDLE_MULTIBYTE) + locale_shiftstates = mblen ((char *)NULL, 0); ++# endif + u32reset (); + #endif + return 1; +-- +2.25.0 +