bash: update 5.1.16 -> 5.2.9

Remove patches:
execute_cmd.patch
(purpose of patch unclear)
makerace.patch/makerace2.patch
(merged upstream)

(From OE-Core rev: 9a12d977cb4a9a5369eebd6b47ffe35c2cb4fca8)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexander Kanavin
2022-11-14 20:00:55 +01:00
committed by Richard Purdie
parent d2b7bf95fc
commit e8a9e74903
5 changed files with 20 additions and 190 deletions

View File

@@ -1,28 +0,0 @@
Upstream-Status: Inappropriate [embedded specific]
Rebase to 5.0
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
execute_cmd.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/execute_cmd.c b/execute_cmd.c
index f1d74bf..31674b4 100644
--- a/execute_cmd.c
+++ b/execute_cmd.c
@@ -2567,7 +2567,11 @@ execute_pipeline (command, asynchronous, pipe_in, pipe_out, fds_to_close)
/* If the `lastpipe' option is set with shopt, and job control is not
enabled, execute the last element of non-async pipelines in the
current shell environment. */
- if (lastpipe_opt && job_control == 0 && asynchronous == 0 && pipe_out == NO_PIPE && prev > 0)
+ if (lastpipe_opt &&
+#if defined(JOB_CONTROL)
+ job_control == 0 &&
+#endif
+ asynchronous == 0 && pipe_out == NO_PIPE && prev > 0)
{
lstdin = move_to_high_fd (0, 1, -1);
if (lstdin > 0)
--
2.7.4

View File

@@ -1,52 +0,0 @@
We're seeing pipesize.h being created in parallel:
/bin/sh ../../bash-5.1/builtins/psize.sh > pipesize.h
/bin/sh ../../bash-5.1/builtins/psize.sh > pipesize.h
./mkbuiltins -D ../../bash-5.1/builtins ../../bash-5.1/builtins/ulimit.def
x86_64-pokysdk-linux-gcc --sysroot=/home/pokybuild/yocto-worker/multilib/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-bash/5.1-r0/recipe-sysroot -c -DHAVE_CONFIG_H -DSHELL -I. -I.. -I../../bash-5.1 -I../../bash-5.1/include -I../../bash-5.1/lib -I../../bash-5.1/builtins -O2 -pipe -fmacro-prefix-map=/home/pokybuild/yocto-worker/multilib/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-bash/5.1-r0=/usr/src/debug/nativesdk-bash/5.1-r0 -fdebug-prefix-map=/home/pokybuild/yocto-worker/multilib/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-bash/5.1-r0=/usr/src/debug/nativesdk-bash/5.1-r0 -fdebug-prefix-map=/home/pokybuild/yocto-worker/multilib/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-bash/5.1-r0/recipe-sysroot= -fdebug-prefix-map=/home/pokybuild/yocto-worker/multilib/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-bash/5.1-r0/recipe-sysroot-native= ulimit.c || ( rm -f ulimit.c ; exit 1 )
make[1]: Leaving directory '/home/pokybuild/yocto-worker/multilib/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-bash/5.1-r0/build/builtins'
rm -f redir.o
x86_64-pokysdk-linux-gcc --sysroot=/home/pokybuild/yocto-worker/multilib/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-bash/5.1-r0/recipe-sysroot -DPROGRAM='"bash"' -DCONF_HOSTTYPE='"x86_64"' -DCONF_OSTYPE='"linux-gnu"' -DCONF_MACHTYPE='"x86_64-pokysdk-linux-gnu"' -DCONF_VENDOR='"pokysdk"' -DLOCALEDIR='"/opt/poky/3.2+snapshot/sysroots/x86_64-pokysdk-linux/usr/share/locale"' -DPACKAGE='"bash"' -DSHELL -DHAVE_CONFIG_H -I. -I../bash-5.1 -I../bash-5.1/include -I../bash-5.1/lib -O2 -pipe -fmacro-prefix-map=/home/pokybuild/yocto-worker/multilib/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-bash/5.1-r0=/usr/src/debug/nativesdk-bash/5.1-r0 -fdebug-prefix-map=/home/pokybuild/yocto-worker/multilib/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-bash/5.1-r0=/usr/src/debug/nativesdk-bash/5.1-r0 -fdebug-prefix-map=/home/pokybuild/yocto-worker/multilib/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-bash/5.1-r0/recipe-sysroot= -fdebug-prefix-map=/home/pokybuild/yocto-worker/multilib/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-bash/5.1-r0/recipe-sysroot-native= -c ../bash-5.1/redir.c
In file included from ../../bash-5.1/builtins/../../bash-5.1/builtins/ulimit.def:95:
pipesize.h:9:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
9 | bash-5.1/builtins/psize.sh: 37: ../../bash-5.1/builtins/psize.sh: ./psize.aux: Text file busy
| ^
make[1]: *** [Makefile:119: ulimit.o] Error 1
make[1]: Leaving directory '/home/pokybuild/yocto-worker/multilib/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-bash/5.1-r0/build/builtins'
make: *** [Makefile:737: builtins/libbuiltins.a] Error 1
make: *** Waiting for unfinished jobs....
In file included from ../bash-5.1/redir.c:61:
./builtins/pipesize.h:9:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
9 | bash-5.1/builtins/psize.sh: 37: ../../bash-5.1/builtins/psize.sh: ./psize.aux: Text file busy
| ^
make: *** [Makefile:101: redir.o] Error 1
WARNING: exit code 1 from a shell command.
which happens since builtins/ulimit.o depends on pipesize.h as well as a top
level dependency. This means:
@(cd $(DEFDIR) && $(MAKE) $(MFLAGS) pipesize.h ) || exit 1
races with:
@(cd $(DEFDIR) && $(MAKE) $(MFLAGS) DEBUG=${DEBUG} targets ) || exit 1
Hack around this by forcing BUILTINS_LIBRARY onto pipesize.h as a dependency.
Upstream-Status: Submitted [https://lists.gnu.org/archive/html/bug-bash/2021-01/msg00152.html]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Index: bash-5.1/Makefile.in
===================================================================
--- bash-5.1.orig/Makefile.in
+++ bash-5.1/Makefile.in
@@ -746,7 +746,7 @@ ${DEFDIR}/bashgetopt.o: $(BUILTIN_SRCDIR
${DEFDIR}/builtext.h: $(BUILTIN_DEFS)
@(cd $(DEFDIR) && $(MAKE) $(MFLAGS) builtext.h ) || exit 1
-${DEFDIR}/pipesize.h:
+${DEFDIR}/pipesize.h: $(BUILTINS_LIBRARY)
@(cd $(DEFDIR) && $(MAKE) $(MFLAGS) pipesize.h ) || exit 1
$(SDIR)/man2html$(EXEEXT): ${SUPPORT_SRC}/man2html.c

View File

@@ -1,98 +0,0 @@
The main makefile can call mkbuiltins from multiple different codepaths in parallel.
When called, it moves the existing files out the way and creates new ones, then
compares which will break the build if timing is unlucky.
The root of the problem is mkbuiltins.c creating a file but also referencing that
file under the same name. By modifing it to allow the final name and the temp name
to be specified, we can avoid the original reason for the moving of files around.
This allows them to be created under a new name and then replaced if changed,
removing any race windows around accessing the files whilst they've been
moved or are being rewritten.
See [YOCTO #14227]
Upstream-Status: Submitted [https://savannah.gnu.org/patch/index.php?10210]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Index: bash-5.1.8/builtins/Makefile.in
===================================================================
--- bash-5.1.8.orig/builtins/Makefile.in
+++ bash-5.1.8/builtins/Makefile.in
@@ -185,19 +185,17 @@ gen-helpfiles: tmpbuiltins.o gen-helpfil
$(CC_FOR_BUILD) ${CCFLAGS_FOR_BUILD} $(LDFLAGS_FOR_BUILD) -o $@ gen-helpfiles.o tmpbuiltins.o $(LIBS_FOR_BUILD)
builtext.h builtins.c: $(MKBUILTINS) $(DEFSRC)
- @-if test -f builtins.c; then mv -f builtins.c old-builtins.c; fi
- @-if test -f builtext.h; then mv -f builtext.h old-builtext.h; fi
- ./$(MKBUILTINS) -externfile builtext.h -structfile builtins.c \
+ ./$(MKBUILTINS) -externfile builtext-new.h -externfinalfile builtext.h -structfile builtins-new.c \
-noproduction $(DIRECTDEFINE) $(HELPDIRDEFINE) $(HELPSTRINGS) $(DEFSRC)
- @-if cmp -s old-builtext.h builtext.h 2>/dev/null; then \
- mv old-builtext.h builtext.h; \
+ @-if ! cmp -s builtext.h builtext-new.h 2>/dev/null; then \
+ mv builtext-new.h builtext.h; \
else \
- $(RM) old-builtext.h; \
+ $(RM) builtext-new.h; \
fi
- @-if cmp -s old-builtins.c builtins.c 2>/dev/null; then \
- mv old-builtins.c builtins.c; \
+ @-if ! cmp -s builtins.c builtins-new.c 2>/dev/null; then \
+ mv builtins-new.c builtins.c; \
else \
- $(RM) old-builtins.c; \
+ $(RM) builtins-new.c; \
fi
helpdoc: gen-helpfiles
Index: bash-5.1.8/builtins/mkbuiltins.c
===================================================================
--- bash-5.1.8.orig/builtins/mkbuiltins.c
+++ bash-5.1.8/builtins/mkbuiltins.c
@@ -113,6 +113,9 @@ char *struct_filename = (char *)NULL;
/* The name of the external declaration file. */
char *extern_filename = (char *)NULL;
+/* The final name of the external declaration file. */
+char *extern_final_filename = (char *)NULL;
+
/* Here is a structure for manipulating arrays of data. */
typedef struct {
int size; /* Number of slots allocated to array. */
@@ -230,6 +233,8 @@ main (argc, argv)
if (strcmp (arg, "-externfile") == 0)
extern_filename = argv[arg_index++];
+ else if (strcmp (arg, "-externfinalfile") == 0)
+ extern_final_filename = argv[arg_index++];
else if (strcmp (arg, "-structfile") == 0)
struct_filename = argv[arg_index++];
else if (strcmp (arg, "-noproduction") == 0)
@@ -273,6 +278,9 @@ main (argc, argv)
}
}
+ if (!extern_final_filename)
+ extern_final_filename = extern_filename;
+
/* If there are no files to process, just quit now. */
if (arg_index == argc)
exit (0);
@@ -1174,7 +1182,7 @@ write_file_headers (structfile, externfi
fprintf (structfile, "%s\n", structfile_header[i]);
fprintf (structfile, "#include \"%s\"\n",
- extern_filename ? extern_filename : "builtext.h");
+ extern_final_filename ? extern_final_filename : "builtext.h");
fprintf (structfile, "#include \"bashintl.h\"\n");
@@ -1184,7 +1192,7 @@ write_file_headers (structfile, externfi
if (externfile)
fprintf (externfile,
"/* %s - The list of builtins found in libbuiltins.a. */\n",
- extern_filename ? extern_filename : "builtext.h");
+ extern_final_filename ? extern_final_filename : "builtext.h");
}
/* Write out any necessary closing information for

View File

@@ -1,3 +1,8 @@
From d1bf23817afffd5917b74da6946e0c3b7e63e336 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Mon, 28 Dec 2020 21:04:27 +0100
Subject: [PATCH] bash: update 5.0 -> 5.1
Including m4 files directly like this confuses autotools.bbclass, remove
the references and rely upon aclocal to collect the m4 files together
as needed instead making it work like other autotools based projects.
@@ -5,17 +10,23 @@ as needed instead making it work like other autotools based projects.
Upstream-Status: Inappropriate [OE configuration specific]
RP 2021/1/20
Index: bash-5.1/configure.ac
===================================================================
--- bash-5.1.orig/configure.ac
+++ bash-5.1/configure.ac
@@ -688,47 +688,6 @@ if test x$SIZE = x; then
---
configure.ac | 43 -------------------------------------------
1 file changed, 43 deletions(-)
diff --git a/configure.ac b/configure.ac
index 50a6e20..a3b5bd7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -710,49 +710,6 @@ if test x$SIZE = x; then
fi
AC_SUBST(SIZE)
-m4_include([m4/stat-time.m4])
-m4_include([m4/timespec.m4])
-
-m4_include([m4/strtoimax.m4])
-
-dnl include files for gettext
-
-m4_include([m4/codeset.m4])
@@ -54,6 +65,6 @@ Index: bash-5.1/configure.ac
-m4_include([m4/wint_t.m4])
-m4_include([m4/xsize.m4])
-
dnl Turn on any extensions available in the GNU C library.
AC_DEFINE(_GNU_SOURCE, 1)
dnl C compiler characteristics
AC_C_CONST
AC_C_INLINE

View File

@@ -5,7 +5,6 @@ LICENSE = "GPL-3.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
SRC_URI = "${GNU_MIRROR}/bash/${BP}.tar.gz;name=tarball \
file://execute_cmd.patch \
file://mkbuiltins_have_stringize.patch \
file://build-tests.patch \
file://test-output.patch \
@@ -13,11 +12,9 @@ SRC_URI = "${GNU_MIRROR}/bash/${BP}.tar.gz;name=tarball \
file://run-bash-ptests \
file://fix-run-builtins.patch \
file://use_aclocal.patch \
file://makerace.patch \
file://makerace2.patch \
"
SRC_URI[tarball.sha256sum] = "5bac17218d3911834520dad13cd1f85ab944e1c09ae1aba55906be1f8192f558"
SRC_URI[tarball.sha256sum] = "68d978264253bc933d692f1de195e2e5b463a3984dfb4e5504b076865f16b6dd"
DEBUG_OPTIMIZATION:append:armv4 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}"
DEBUG_OPTIMIZATION:append:armv5 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}"