summaryrefslogtreecommitdiffstats
path: root/import-layers/yocto-poky/meta/recipes-extended/bash/bash
diff options
context:
space:
mode:
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-extended/bash/bash')
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash/build-tests.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash/execute_cmd.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch169
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash/run-ptest2
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash/test-output.patch25
6 files changed, 294 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash/build-tests.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/build-tests.patch
new file mode 100644
index 000000000..73a81b60d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/build-tests.patch
@@ -0,0 +1,55 @@
+Add 'ptest' target to Makefile, to run tests without checking dependencies.
+
+Upstream-Status: Pending
+Signed-off-by: Anders Roxell <anders.roxell@enea.com>
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile.in | 24 +++++++++++++++++++-----
+ 1 file changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -848,20 +848,34 @@ maybe-clean:
+ fi
+
+ recho$(EXEEXT): $(SUPPORT_SRC)recho.c
+- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)recho.c ${LIBS_FOR_BUILD}
++ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
+
+ zecho$(EXEEXT): $(SUPPORT_SRC)zecho.c
+- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)zecho.c ${LIBS_FOR_BUILD}
++ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
+
+ printenv$(EXEEXT): $(SUPPORT_SRC)printenv.c
+- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)printenv.c ${LIBS_FOR_BUILD}
++ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
+
+ xcase$(EXEEXT): $(SUPPORT_SRC)xcase.c
+- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)xcase.c ${LIBS_FOR_BUILD}
++ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
+
+-test tests check: force $(Program) $(TESTS_SUPPORT)
++test tests check:
++ @$(MAKE) install-test
++ @$(MAKE) runtest
++
++install-test: buildtest
++ifeq ($(origin INSTALL_TEST_DIR), undefined)
+ @-test -d tests || mkdir tests
+ @cp $(TESTS_SUPPORT) tests
++else
++ @-test -d $(INSTALL_TEST_DIR) || mkdir -p $(INSTALL_TEST_DIR)
++ @cp -r $(srcdir)/tests/* $(INSTALL_TEST_DIR)/
++ @cp $(TESTS_SUPPORT) $(INSTALL_TEST_DIR)
++endif
++
++buildtest: force $(Program) $(TESTS_SUPPORT)
++
++runtest:
+ @( cd $(srcdir)/tests && \
+ PATH=$(BUILD_DIR)/tests:$$PATH THIS_SH=$(THIS_SH) $(SHELL) ${TESTSCRIPT} )
+
+--
+1.8.1.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash/execute_cmd.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/execute_cmd.patch
new file mode 100644
index 000000000..81f8f0a9c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/execute_cmd.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+--- execute_cmd.c.orig Fri Jun 3 13:34:42 2011
++++ execute_cmd.c Fri Jun 3 13:36:41 2011
+@@ -2202,7 +2202,11 @@
+ /* 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, 0, 255);
+ if (lstdin > 0)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch
new file mode 100644
index 000000000..7f099ae0c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch
@@ -0,0 +1,169 @@
+From 2c30dff8ea8b17ad5ba9881e35ad1eba9c515f13 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 26 Nov 2015 22:09:07 -0500
+Subject: [PATCH] fix run-coproc/run-heredoc/run-execscript/run-test/ failed
+
+FAIL: run-coproc
+update test case:tests/coproc.right, tests/coproc.tests
+git://git.sv.gnu.org/bash.git bash-4.4-testing
+
+FAIL: run-heredoc
+update test case: tests/heredoc.right tests/heredoc3.sub
+git://git.sv.gnu.org/bash.git bash-4.4-testing
+
+FAIL: run-execscript:
+the test suite should not be run as root
+
+FAIL: run-test
+the test suite should not be run as root
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ tests/coproc.right | 5 +----
+ tests/coproc.tests | 30 +++++++++++++++++++++++++-----
+ tests/heredoc.right | 5 ++---
+ tests/heredoc3.sub | 3 ++-
+ tests/run-execscript | 3 ++-
+ tests/run-test | 3 ++-
+ 6 files changed, 34 insertions(+), 15 deletions(-)
+
+diff --git a/tests/coproc.right b/tests/coproc.right
+index 6d9deaa..94b001c 100644
+--- a/tests/coproc.right
++++ b/tests/coproc.right
+@@ -1,11 +1,8 @@
+-84575
+ 63 60
+ a b c
+-84577
+ 63 60
+ flop
+-./coproc.tests: line 22: 84577 Terminated coproc REFLECT { cat -; }
+-84579
++coproc.tests: REFLECT: status 143
+ 63 60
+ FOO
+ 63 60
+diff --git a/tests/coproc.tests b/tests/coproc.tests
+index 8be3563..d347eb7 100644
+--- a/tests/coproc.tests
++++ b/tests/coproc.tests
+@@ -1,6 +1,13 @@
++: ${TMPDIR:=/tmp}
++TMPOUT=${TMPDIR}/coproc-wait-$BASHPID
++
+ coproc { echo a b c; sleep 2; }
+
+-echo $COPROC_PID
++case $COPROC_PID in
++[0-9]*) ;;
++*) echo COPROC_PID not integer ;;
++esac
++
+ echo ${COPROC[@]}
+
+ read LINE <&${COPROC[0]}
+@@ -10,7 +17,11 @@ wait $COPROC_PID
+
+ coproc REFLECT { cat - ; }
+
+-echo $REFLECT_PID
++case $REFLECT_PID in
++[0-9]*) ;;
++*) echo REFLECT_PID not integer ;;
++esac
++
+ echo ${REFLECT[@]}
+
+ echo flop >&${REFLECT[1]}
+@@ -18,12 +29,21 @@ read LINE <&${REFLECT[0]}
+
+ echo $LINE
+
+-kill $REFLECT_PID
+-wait $REFLECT_PID
++{ sleep 1; kill $REFLECT_PID; } &
++wait $REFLECT_PID >$TMPOUT 2>&1 || echo "coproc.tests: REFLECT: status $?"
++grep 'Terminated.*coproc.*REFLECT' < $TMPOUT >/dev/null 2>&1 || {
++ echo "coproc.tests: wait for REFLECT failed" >&2
++}
++rm -f $TMPOUT
++exec 2>&1
+
+ coproc xcase -n -u
+
+-echo $COPROC_PID
++case $COPROC_PID in
++[0-9]*) ;;
++*) echo COPROC_PID not integer ;;
++esac
++
+ echo ${COPROC[@]}
+
+ echo foo >&${COPROC[1]}
+diff --git a/tests/heredoc.right b/tests/heredoc.right
+index 6abaa1f..8df91c5 100644
+--- a/tests/heredoc.right
++++ b/tests/heredoc.right
+@@ -76,15 +76,14 @@ ENDEND
+ end ENDEND
+ hello
+ end hello
+-x star x
+ end x*x
+ helloEND
+ end helloEND
+ hello
+ \END
+ end hello<NL>\END
+-./heredoc3.sub: line 74: warning: here-document at line 72 delimited by end-of-file (wanted `EOF')
+-./heredoc3.sub: line 75: syntax error: unexpected end of file
++./heredoc3.sub: line 75: warning: here-document at line 73 delimited by end-of-file (wanted `EOF')
++./heredoc3.sub: line 76: syntax error: unexpected end of file
+ comsub here-string
+ ./heredoc.tests: line 105: warning: here-document at line 103 delimited by end-of-file (wanted `EOF')
+ hi
+diff --git a/tests/heredoc3.sub b/tests/heredoc3.sub
+index 73a111e..9d3d846 100644
+--- a/tests/heredoc3.sub
++++ b/tests/heredoc3.sub
+@@ -49,9 +49,10 @@ hello
+ END
+ echo end hello
+
+-cat <<x*x & touch 'x*x'
++cat <<x*x >/dev/null & touch 'x*x'
+ x star x
+ x*x
++wait $!
+ echo end 'x*x'
+ rm 'x*x'
+
+diff --git a/tests/run-execscript b/tests/run-execscript
+index f97ab21..0d00a1b 100644
+--- a/tests/run-execscript
++++ b/tests/run-execscript
+@@ -5,5 +5,6 @@ echo "warning: \`/tmp/bash-notthere' not being found or \`/' being a directory"
+ echo "warning: produce diff output, please do not consider this a test failure" >&2
+ echo "warning: if diff output differing only in the location of the bash" >&2
+ echo "warning: binary appears, please do not consider this a test failure" >&2
+-${THIS_SH} ./execscript > /tmp/xx 2>&1
++rm -f /tmp/xx
++su -c "${THIS_SH} ./execscript > /tmp/xx 2>&1" test
+ diff /tmp/xx exec.right && rm -f /tmp/xx
+diff --git a/tests/run-test b/tests/run-test
+index b2482c3..2e8f049 100644
+--- a/tests/run-test
++++ b/tests/run-test
+@@ -1,4 +1,5 @@
+ unset GROUPS UID 2>/dev/null
+
+-${THIS_SH} ./test.tests >/tmp/xx 2>&1
++rm -f /tmp/xx
++su -c "${THIS_SH} ./test.tests >/tmp/xx 2>&1" test
+ diff /tmp/xx test.right && rm -f /tmp/xx
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch
new file mode 100644
index 000000000..a9391d6ca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch
@@ -0,0 +1,26 @@
+On hosts with FORTIFY_SOURCES, stringize support is required, as it's used by
+the macros to wrap functions (e.g. read and open in unistd.h). Those wrappers
+use the STRING() macro from unistd.h. A header in the bash sources overrides
+the unistd.h macro to 'x' when HAVE_STRINGIZE is not defined, causing the
+wrappers to generate calls to 'xread' and 'xopen', which do not exist,
+resulting in a failure to link.
+
+Assume we have stringize support when cross-compiling, which works around the
+issue.
+
+It may be best for upstream to either give up on supporting compilers without
+stringize support, or to not define STRING() at all when FORTIFY_SOURCES is
+defined, letting the unistd.h one be used, instead.
+
+Upstream-Status: Pending
+
+--- bash-4.2.orig/builtins/mkbuiltins.c
++++ bash-4.2/builtins/mkbuiltins.c
+@@ -28,6 +28,7 @@
+ # define HAVE_STDLIB_H
+
+ # define HAVE_RENAME
++# define HAVE_STRINGIZE
+ #endif /* CROSS_COMPILING */
+
+ #if defined (HAVE_UNISTD_H)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/run-ptest
new file mode 100644
index 000000000..2098fa46b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -k THIS_SH=/bin/bash BUILD_DIR=`pwd` srcdir=`pwd` runtest
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash/test-output.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/test-output.patch
new file mode 100644
index 000000000..2b09b7d97
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/test-output.patch
@@ -0,0 +1,25 @@
+Add FAIL/PASS output to test output.
+
+Signed-off-by: Björn Stenberg <bjst@enea.com>
+Upstream-Status: Pending
+---
+diff -uNr a/tests/run-all b/tests/run-all
+--- a/tests/run-all 1999-10-08 17:07:46.000000000 +0200
++++ b/tests/run-all 2012-10-27 21:04:18.663331887 +0200
+@@ -22,7 +22,15 @@
+ case $x in
+ $0|run-minimal|run-gprof) ;;
+ *.orig|*~) ;;
+- *) echo $x ; sh $x ;;
++ *) echo $x
++ output=`sh $x`
++ if [ -n "$output" ]; then
++ echo "$output"
++ echo "FAIL: $x"
++ else
++ echo "PASS: $x"
++ fi
++ ;;
+ esac
+ done
+
OpenPOWER on IntegriCloud