diff options
| author | Hongxu Jia <hongxu.jia@windriver.com> | 2025-07-21 16:21:01 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-07-31 10:48:35 +0100 |
| commit | 55359a65a185f8e3f36459052f2bf407be11f7e8 (patch) | |
| tree | 353568654f60c021d9aa99e1e6f8355781bb7226 | |
| parent | 94ec6a38c9735fad4cde0eb5c64f62067bc634f6 (diff) | |
| download | poky-55359a65a185f8e3f36459052f2bf407be11f7e8.tar.gz | |
bash: upgrade 5.2.37 -> 5.3
Refresh patch to 5.3
- mkbuiltins_have_stringize.patch
Drop backport patch
- 0001-changes-to-SIGINT-handler-while-waiting-for-a-child-.patch
- fix-filesubst-errexit.patch
(From OE-Core rev: 208e98f471b2329d07c216d135d238a1f74f0a2e)
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-extended/bash/bash/0001-changes-to-SIGINT-handler-while-waiting-for-a-child-.patch | 223 | ||||
| -rw-r--r-- | meta/recipes-extended/bash/bash/fix-filesubst-errexit.patch | 31 | ||||
| -rw-r--r-- | meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch | 24 | ||||
| -rw-r--r-- | meta/recipes-extended/bash/bash_5.3.bb (renamed from meta/recipes-extended/bash/bash_5.2.37.bb) | 4 |
4 files changed, 17 insertions, 265 deletions
diff --git a/meta/recipes-extended/bash/bash/0001-changes-to-SIGINT-handler-while-waiting-for-a-child-.patch b/meta/recipes-extended/bash/bash/0001-changes-to-SIGINT-handler-while-waiting-for-a-child-.patch deleted file mode 100644 index 4e73edb9b3..0000000000 --- a/meta/recipes-extended/bash/bash/0001-changes-to-SIGINT-handler-while-waiting-for-a-child-.patch +++ /dev/null | |||
| @@ -1,223 +0,0 @@ | |||
| 1 | From e4b9493ae4923595ec3ca67f85322129fb3056cf Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Chet Ramey <chet.ramey@case.edu> | ||
| 3 | Date: Mon, 30 Oct 2023 12:16:07 -0400 | ||
| 4 | Subject: [PATCH] changes to SIGINT handler while waiting for a child; skip | ||
| 5 | vertical whitespace after translating an integer | ||
| 6 | |||
| 7 | Upstream-Status: Backport from | ||
| 8 | [https://git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=fe24a6a55e8850298b496c5b9d82f1866eba190e] | ||
| 9 | |||
| 10 | [Adjust and drop some codes to be applicable the tree] | ||
| 11 | |||
| 12 | Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com> | ||
| 13 | --- | ||
| 14 | general.c | 5 +++-- | ||
| 15 | jobs.c | 24 ++++++++++++++++-------- | ||
| 16 | tests/redir.right | 4 ++-- | ||
| 17 | tests/redir11.sub | 2 ++ | ||
| 18 | tests/type.right | 16 ++++++++-------- | ||
| 19 | tests/type.tests | 24 ++++++++++++------------ | ||
| 20 | 6 files changed, 43 insertions(+), 32 deletions(-) | ||
| 21 | |||
| 22 | diff --git a/general.c b/general.c | ||
| 23 | index bda39f4..94a5339 100644 | ||
| 24 | --- a/general.c | ||
| 25 | +++ b/general.c | ||
| 26 | @@ -264,8 +264,9 @@ legal_number (string, result) | ||
| 27 | if (errno || ep == string) | ||
| 28 | return 0; /* errno is set on overflow or underflow */ | ||
| 29 | |||
| 30 | - /* Skip any trailing whitespace, since strtoimax does not. */ | ||
| 31 | - while (whitespace (*ep)) | ||
| 32 | + /* Skip any trailing whitespace, since strtoimax does not, using the same | ||
| 33 | + test that strtoimax uses for leading whitespace. */ | ||
| 34 | + while (isspace ((unsigned char) *ep)) | ||
| 35 | ep++; | ||
| 36 | |||
| 37 | /* If *string is not '\0' but *ep is '\0' on return, the entire string | ||
| 38 | diff --git a/jobs.c b/jobs.c | ||
| 39 | index d3e4ab0..903cf9c 100644 | ||
| 40 | --- a/jobs.c | ||
| 41 | +++ b/jobs.c | ||
| 42 | @@ -2718,6 +2718,10 @@ wait_for_background_pids (ps) | ||
| 43 | #define INVALID_SIGNAL_HANDLER (SigHandler *)wait_for_background_pids | ||
| 44 | static SigHandler *old_sigint_handler = INVALID_SIGNAL_HANDLER; | ||
| 45 | |||
| 46 | +/* The current SIGINT handler as set by restore_sigint_handler. Only valid | ||
| 47 | + immediately after restore_sigint_handler, used for continuations. */ | ||
| 48 | +static SigHandler *cur_sigint_handler = INVALID_SIGNAL_HANDLER; | ||
| 49 | + | ||
| 50 | static int wait_sigint_received; | ||
| 51 | static int child_caught_sigint; | ||
| 52 | |||
| 53 | @@ -2735,6 +2739,7 @@ wait_sigint_cleanup () | ||
| 54 | static void | ||
| 55 | restore_sigint_handler () | ||
| 56 | { | ||
| 57 | + cur_sigint_handler = old_sigint_handler; | ||
| 58 | if (old_sigint_handler != INVALID_SIGNAL_HANDLER) | ||
| 59 | { | ||
| 60 | set_signal_handler (SIGINT, old_sigint_handler); | ||
| 61 | @@ -2758,8 +2763,7 @@ wait_sigint_handler (sig) | ||
| 62 | restore_sigint_handler (); | ||
| 63 | /* If we got a SIGINT while in `wait', and SIGINT is trapped, do | ||
| 64 | what POSIX.2 says (see builtins/wait.def for more info). */ | ||
| 65 | - if (this_shell_builtin && this_shell_builtin == wait_builtin && | ||
| 66 | - signal_is_trapped (SIGINT) && | ||
| 67 | + if (signal_is_trapped (SIGINT) && | ||
| 68 | ((sigint_handler = trap_to_sighandler (SIGINT)) == trap_handler)) | ||
| 69 | { | ||
| 70 | trap_handler (SIGINT); /* set pending_traps[SIGINT] */ | ||
| 71 | @@ -2782,6 +2786,8 @@ wait_sigint_handler (sig) | ||
| 72 | { | ||
| 73 | set_exit_status (128+SIGINT); | ||
| 74 | restore_sigint_handler (); | ||
| 75 | + if (cur_sigint_handler == INVALID_SIGNAL_HANDLER) | ||
| 76 | + set_sigint_handler (); /* XXX - only do this in one place */ | ||
| 77 | kill (getpid (), SIGINT); | ||
| 78 | } | ||
| 79 | |||
| 80 | @@ -2926,11 +2932,13 @@ wait_for (pid, flags) | ||
| 81 | { | ||
| 82 | SigHandler *temp_sigint_handler; | ||
| 83 | |||
| 84 | - temp_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler); | ||
| 85 | - if (temp_sigint_handler == wait_sigint_handler) | ||
| 86 | - internal_debug ("wait_for: recursively setting old_sigint_handler to wait_sigint_handler: running_trap = %d", running_trap); | ||
| 87 | - else | ||
| 88 | - old_sigint_handler = temp_sigint_handler; | ||
| 89 | + temp_sigint_handler = old_sigint_handler; | ||
| 90 | + old_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler); | ||
| 91 | + if (old_sigint_handler == wait_sigint_handler) | ||
| 92 | + { | ||
| 93 | + internal_debug ("wait_for: recursively setting old_sigint_handler to wait_sigint_handler: running_trap = %d", running_trap); | ||
| 94 | + old_sigint_handler = temp_sigint_handler; | ||
| 95 | + } | ||
| 96 | waiting_for_child = 0; | ||
| 97 | if (old_sigint_handler == SIG_IGN) | ||
| 98 | set_signal_handler (SIGINT, old_sigint_handler); | ||
| 99 | @@ -4141,7 +4149,7 @@ set_job_status_and_cleanup (job) | ||
| 100 | SIGINT (if we reset the sighandler to the default). | ||
| 101 | In this case, we have to fix things up. What a crock. */ | ||
| 102 | if (temp_handler == trap_handler && signal_is_trapped (SIGINT) == 0) | ||
| 103 | - temp_handler = trap_to_sighandler (SIGINT); | ||
| 104 | + temp_handler = trap_to_sighandler (SIGINT); | ||
| 105 | restore_sigint_handler (); | ||
| 106 | if (temp_handler == SIG_DFL) | ||
| 107 | termsig_handler (SIGINT); /* XXX */ | ||
| 108 | diff --git a/tests/redir.right b/tests/redir.right | ||
| 109 | index 8db1041..9e1403c 100644 | ||
| 110 | --- a/tests/redir.right | ||
| 111 | +++ b/tests/redir.right | ||
| 112 | @@ -154,10 +154,10 @@ foo | ||
| 113 | 1 | ||
| 114 | 7 | ||
| 115 | after: 42 | ||
| 116 | -./redir11.sub: line 53: $(ss= declare -i ss): ambiguous redirect | ||
| 117 | +./redir11.sub: line 55: $(ss= declare -i ss): ambiguous redirect | ||
| 118 | after: 42 | ||
| 119 | a+=3 | ||
| 120 | foo | ||
| 121 | foo | ||
| 122 | -./redir11.sub: line 75: 42: No such file or directory | ||
| 123 | +./redir11.sub: line 77: 42: No such file or directory | ||
| 124 | 42 | ||
| 125 | diff --git a/tests/redir11.sub b/tests/redir11.sub | ||
| 126 | index d417cdb..ca9854c 100644 | ||
| 127 | --- a/tests/redir11.sub | ||
| 128 | +++ b/tests/redir11.sub | ||
| 129 | @@ -34,6 +34,8 @@ a=4 b=7 ss=4 declare -i ss | ||
| 130 | a=4 b=7 foo | ||
| 131 | echo after: $a | ||
| 132 | |||
| 133 | +exec 7>&- 4>&- | ||
| 134 | + | ||
| 135 | unset a | ||
| 136 | a=4 echo foo 2>&1 >&$(foo) | { grep -q 'Bad file' || echo 'redir11 bad 3'; } | ||
| 137 | a=1 echo foo 2>&1 >&$(foo) | { grep -q 'Bad file' || echo 'redir11 bad 4'; } | ||
| 138 | diff --git a/tests/type.right b/tests/type.right | ||
| 139 | index bbc228e..c0c1c8b 100644 | ||
| 140 | --- a/tests/type.right | ||
| 141 | +++ b/tests/type.right | ||
| 142 | @@ -24,15 +24,15 @@ func () | ||
| 143 | } | ||
| 144 | while | ||
| 145 | while is a shell keyword | ||
| 146 | -./type.tests: line 56: type: m: not found | ||
| 147 | -alias m='more' | ||
| 148 | -alias m='more' | ||
| 149 | -m is aliased to `more' | ||
| 150 | +./type.tests: line 56: type: morealias: not found | ||
| 151 | +alias morealias='more' | ||
| 152 | +alias morealias='more' | ||
| 153 | +morealias is aliased to `more' | ||
| 154 | alias | ||
| 155 | -alias m='more' | ||
| 156 | -alias m='more' | ||
| 157 | -alias m='more' | ||
| 158 | -m is aliased to `more' | ||
| 159 | +alias morealias='more' | ||
| 160 | +alias morealias='more' | ||
| 161 | +alias morealias='more' | ||
| 162 | +morealias is aliased to `more' | ||
| 163 | builtin | ||
| 164 | builtin is a shell builtin | ||
| 165 | /bin/sh | ||
| 166 | diff --git a/tests/type.tests b/tests/type.tests | ||
| 167 | index fd39c18..ddc1540 100644 | ||
| 168 | --- a/tests/type.tests | ||
| 169 | +++ b/tests/type.tests | ||
| 170 | @@ -25,8 +25,6 @@ type -r ${THIS_SH} | ||
| 171 | type notthere | ||
| 172 | command -v notthere | ||
| 173 | |||
| 174 | -alias m=more | ||
| 175 | - | ||
| 176 | unset -f func 2>/dev/null | ||
| 177 | func() { echo this is func; } | ||
| 178 | |||
| 179 | @@ -49,24 +47,26 @@ command -V func | ||
| 180 | command -v while | ||
| 181 | command -V while | ||
| 182 | |||
| 183 | +alias morealias=more | ||
| 184 | + | ||
| 185 | # the following two lines should produce the same output | ||
| 186 | # post-3.0 patch makes command -v silent, as posix specifies | ||
| 187 | # first test with alias expansion off (should all fail or produce no output) | ||
| 188 | -type -t m | ||
| 189 | -type m | ||
| 190 | -command -v m | ||
| 191 | +type -t morealias | ||
| 192 | +type morealias | ||
| 193 | +command -v morealias | ||
| 194 | alias -p | ||
| 195 | -alias m | ||
| 196 | +alias morealias | ||
| 197 | |||
| 198 | # then test with alias expansion on | ||
| 199 | shopt -s expand_aliases | ||
| 200 | -type m | ||
| 201 | -type -t m | ||
| 202 | -command -v m | ||
| 203 | +type morealias | ||
| 204 | +type -t morealias | ||
| 205 | +command -v morealias | ||
| 206 | alias -p | ||
| 207 | -alias m | ||
| 208 | +alias morealias | ||
| 209 | |||
| 210 | -command -V m | ||
| 211 | +command -V morealias | ||
| 212 | shopt -u expand_aliases | ||
| 213 | |||
| 214 | command -v builtin | ||
| 215 | @@ -76,7 +76,7 @@ command -V /bin/sh | ||
| 216 | |||
| 217 | unset -f func | ||
| 218 | type func | ||
| 219 | -unalias m | ||
| 220 | +unalias morealias | ||
| 221 | type m | ||
| 222 | |||
| 223 | hash -r | ||
diff --git a/meta/recipes-extended/bash/bash/fix-filesubst-errexit.patch b/meta/recipes-extended/bash/bash/fix-filesubst-errexit.patch deleted file mode 100644 index c5082ee355..0000000000 --- a/meta/recipes-extended/bash/bash/fix-filesubst-errexit.patch +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | From 16951b74971c7fd38fd036dac1410a9e53cbe736 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Chet Ramey <chet.ramey@case.edu> | ||
| 3 | Date: Fri, 7 Apr 2023 00:28:46 -0700 | ||
| 4 | Subject: [PATCH] $(<nosuchfile) is no longer a fatal error with errexit | ||
| 5 | enabled | ||
| 6 | |||
| 7 | This is a trimmed-down version of a commit in the bash 'devel' branch | ||
| 8 | [1] that contains this fix as well as other unrelated ones. | ||
| 9 | |||
| 10 | [1] https://git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=ec9447ce9392a0f93d96789c3741285fede8a150 | ||
| 11 | |||
| 12 | Upstream-Status: Backport | ||
| 13 | |||
| 14 | Signed-off-by: Zev Weiss <zev@bewilderbeest.net> | ||
| 15 | --- | ||
| 16 | builtins/evalstring.c | 2 +- | ||
| 17 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 18 | |||
| 19 | diff --git a/builtins/evalstring.c b/builtins/evalstring.c | ||
| 20 | index 53a7c0b..c5075cc 100644 | ||
| 21 | --- a/builtins/evalstring.c | ||
| 22 | +++ b/builtins/evalstring.c | ||
| 23 | @@ -753,7 +753,7 @@ open_redir_file (r, fnp) | ||
| 24 | fd = open(fn, O_RDONLY); | ||
| 25 | if (fd < 0) | ||
| 26 | { | ||
| 27 | - file_error (fn); | ||
| 28 | + internal_error ("%s: %s", fn, strerror (errno)); | ||
| 29 | free (fn); | ||
| 30 | if (fnp) | ||
| 31 | *fnp = 0; | ||
diff --git a/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch b/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch index eb29e7d836..4ee754e32b 100644 --- a/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch +++ b/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | From d11685286144c2e5630545e435d11387b2908fd0 Mon Sep 17 00:00:00 2001 | 1 | From ed7515a5c07addaa3338a24efb36b74fbd1844dc Mon Sep 17 00:00:00 2001 |
| 2 | From: Christopher Larson <chris_larson@mentor.com> | 2 | From: Christopher Larson <chris_larson@mentor.com> |
| 3 | Date: Wed, 14 Nov 2012 07:55:09 -0700 | 3 | Date: Mon, 21 Jul 2025 13:52:00 +0800 |
| 4 | Subject: [PATCH] bash: fix mkbuiltins build failure | 4 | Subject: [PATCH] bash: fix mkbuiltins build failure |
| 5 | 5 | ||
| 6 | On hosts with FORTIFY_SOURCES, stringize support is required, as it's used by | 6 | On hosts with FORTIFY_SOURCES, stringize support is required, as it's used by |
| @@ -18,19 +18,27 @@ stringize support, or to not define STRING() at all when FORTIFY_SOURCES is | |||
| 18 | defined, letting the unistd.h one be used, instead. | 18 | defined, letting the unistd.h one be used, instead. |
| 19 | 19 | ||
| 20 | Upstream-Status: Pending | 20 | Upstream-Status: Pending |
| 21 | |||
| 22 | Signed-off-by: Christopher Larson <chris_larson@mentor.com> | ||
| 23 | |||
| 24 | Rebase to 5.3 | ||
| 25 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 21 | --- | 26 | --- |
| 22 | builtins/mkbuiltins.c | 1 + | 27 | builtins/mkbuiltins.c | 1 + |
| 23 | 1 file changed, 1 insertion(+) | 28 | 1 file changed, 1 insertion(+) |
| 24 | 29 | ||
| 25 | diff --git a/builtins/mkbuiltins.c b/builtins/mkbuiltins.c | 30 | diff --git a/builtins/mkbuiltins.c b/builtins/mkbuiltins.c |
| 26 | index f505ebd..b5b2eed 100644 | 31 | index c4cacdf..05d1db1 100644 |
| 27 | --- a/builtins/mkbuiltins.c | 32 | --- a/builtins/mkbuiltins.c |
| 28 | +++ b/builtins/mkbuiltins.c | 33 | +++ b/builtins/mkbuiltins.c |
| 29 | @@ -28,6 +28,7 @@ | 34 | @@ -24,6 +24,7 @@ |
| 30 | # define HAVE_STDLIB_H | 35 | #else /* CROSS_COMPILING */ |
| 31 | 36 | /* A conservative set of defines based on POSIX/SUS3/XPG6 */ | |
| 32 | # define HAVE_RENAME | 37 | # include <buildconf.h> |
| 33 | +# define HAVE_STRINGIZE | 38 | +# define HAVE_STRINGIZE |
| 34 | #endif /* CROSS_COMPILING */ | 39 | #endif /* CROSS_COMPILING */ |
| 35 | 40 | ||
| 36 | #if defined (HAVE_UNISTD_H) | 41 | #if defined (HAVE_UNISTD_H) |
| 42 | -- | ||
| 43 | 2.34.1 | ||
| 44 | |||
diff --git a/meta/recipes-extended/bash/bash_5.2.37.bb b/meta/recipes-extended/bash/bash_5.3.bb index 2c0645cbd9..c241ea6d3b 100644 --- a/meta/recipes-extended/bash/bash_5.2.37.bb +++ b/meta/recipes-extended/bash/bash_5.3.bb | |||
| @@ -11,11 +11,9 @@ SRC_URI = "${GNU_MIRROR}/bash/${BP}.tar.gz;name=tarball \ | |||
| 11 | file://run-ptest \ | 11 | file://run-ptest \ |
| 12 | file://run-bash-ptests \ | 12 | file://run-bash-ptests \ |
| 13 | file://fix-run-builtins.patch \ | 13 | file://fix-run-builtins.patch \ |
| 14 | file://0001-changes-to-SIGINT-handler-while-waiting-for-a-child-.patch \ | ||
| 15 | file://fix-filesubst-errexit.patch \ | ||
| 16 | " | 14 | " |
| 17 | 15 | ||
| 18 | SRC_URI[tarball.sha256sum] = "9599b22ecd1d5787ad7d3b7bf0c59f312b3396d1e281175dd1f8a4014da621ff" | 16 | SRC_URI[tarball.sha256sum] = "62dd49c44c399ed1b3f7f731e87a782334d834f08e098a35f2c87547d5dbb269" |
| 19 | 17 | ||
| 20 | DEBUG_OPTIMIZATION:append:armv4 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}" | 18 | DEBUG_OPTIMIZATION:append:armv4 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}" |
| 21 | DEBUG_OPTIMIZATION:append:armv5 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}" | 19 | DEBUG_OPTIMIZATION:append:armv5 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}" |
