From 47a74ffa8137c22686e6196e0b1e74861d1bd81c Mon Sep 17 00:00:00 2001 From: Vincent Fazio Date: Sat, 28 Jan 2023 13:14:09 -0600 Subject: [PATCH] package/bash: fix non-multibyte builds Builds using toolchains without WCHAR support would fail due to an undeclared reference to `shell_input_line_property`. Fix this by using a guard to check if ENABLE_MULTIBYTE is defined. Fixes: - http://autobuild.buildroot.net/results/133ddcbc37512e6bcc5daab669ce316efa7ec4fc/ Signed-off-by: Vincent Fazio Signed-off-by: Yann E. MORIN --- ...compilation-for-non-multibyte-builds.patch | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 package/bash/0002-parse.y-fix-compilation-for-non-multibyte-builds.patch diff --git a/package/bash/0002-parse.y-fix-compilation-for-non-multibyte-builds.patch b/package/bash/0002-parse.y-fix-compilation-for-non-multibyte-builds.patch new file mode 100644 index 0000000000..d330de5cd4 --- /dev/null +++ b/package/bash/0002-parse.y-fix-compilation-for-non-multibyte-builds.patch @@ -0,0 +1,63 @@ +From 0217fc2816e47ee296472df71d1011f0eb2937e6 Mon Sep 17 00:00:00 2001 +From: Vincent Fazio +Date: Fri, 27 Jan 2023 14:37:26 -0600 +Subject: [PATCH] parse.y: fix compilation for non-multibyte builds + +Builds configured with --disable-multibyte or when the toolchain does +not have WCHAR support would encounter a compile error due to an +undeclared reference to shell_input_line_property in shell_getc. + +Add a HANDLE_MULTIBYTE guard to conditionally compile the block that +references shell_input_line_property in shell_getc as it's only declared +when HANDLE_MULTIBYTE is defined. + +Signed-off-by: Vincent Fazio +[Upstream status: https://savannah.gnu.org/patch/index.php?10309] +--- + parse.y | 2 ++ + y.tab.c | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/parse.y b/parse.y +index 1d12e639..8f1355c6 100644 +--- a/parse.y ++++ b/parse.y +@@ -2625,6 +2625,7 @@ next_alias_char: + parser_state |= PST_ENDALIAS; + /* We need to do this to make sure last_shell_getc_is_singlebyte returns + true, since we are returning a single-byte space. */ ++#if defined (HANDLE_MULTIBYTE) + if (shell_input_line_index == shell_input_line_len && last_shell_getc_is_singlebyte == 0) + { + #if 0 +@@ -2638,6 +2639,7 @@ next_alias_char: + shell_input_line_property[shell_input_line_index - 1] = 1; + #endif + } ++#endif /* HANDLE_MULTIBYTE */ + return ' '; /* END_ALIAS */ + } + #endif +diff --git a/y.tab.c b/y.tab.c +index 50c5845b..799f730f 100644 +--- a/y.tab.c ++++ b/y.tab.c +@@ -4936,6 +4936,7 @@ next_alias_char: + parser_state |= PST_ENDALIAS; + /* We need to do this to make sure last_shell_getc_is_singlebyte returns + true, since we are returning a single-byte space. */ ++#if defined (HANDLE_MULTIBYTE) + if (shell_input_line_index == shell_input_line_len && last_shell_getc_is_singlebyte == 0) + { + #if 0 +@@ -4949,6 +4950,7 @@ next_alias_char: + shell_input_line_property[shell_input_line_index - 1] = 1; + #endif + } ++#endif /* HANDLE_MULTIBYTE */ + return ' '; /* END_ALIAS */ + } + #endif +-- +2.25.1 +