* [PATCH v2] linux-libc-headers: Fix build failure by using fixed temporary file instead of pipe for here-doc
@ 2018-11-21 11:15 zhe.he
2018-11-21 11:33 ` ✗ patchtest: failure for " Patchwork
0 siblings, 1 reply; 2+ messages in thread
From: zhe.he @ 2018-11-21 11:15 UTC (permalink / raw)
To: openembedded-core; +Cc: bruce.ashfield
From: He Zhe <zhe.he@windriver.com>
This is a workaround for the following possible build failure.
*** Compiler lacks asm-goto support.. Stop.
When building linux-libc-headers we need to use binutils on build machine.
binutils v2.31 introduces a bug that could cause scripts/gcc-goto.sh to fail
when running in an environment where /tmp is rarely used, e.g. in docker.
Signed-off-by: He Zhe <zhe.he@windriver.com>
---
v2: Improve commit log
...-fixed-temporary-file-instead-of-pipe-for.patch | 68 ++++++++++++++++++++++
| 4 ++
2 files changed, 72 insertions(+)
create mode 100644 meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-scripts-Use-fixed-temporary-file-instead-of-pipe-for.patch
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-scripts-Use-fixed-temporary-file-instead-of-pipe-for.patch b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-scripts-Use-fixed-temporary-file-instead-of-pipe-for.patch
new file mode 100644
index 0000000..345c788
--- /dev/null
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-scripts-Use-fixed-temporary-file-instead-of-pipe-for.patch
@@ -0,0 +1,68 @@
+From 3bbea65e11918f8753e8006a2198b999cdb0af58 Mon Sep 17 00:00:00 2001
+From: He Zhe <zhe.he@windriver.com>
+Date: Wed, 21 Nov 2018 15:12:43 +0800
+Subject: [PATCH] scripts: Use fixed temporary file instead of pipe for
+ here-doc
+
+There was a bug of "as" in binutils that when it checks if the input file and
+output file are the same one, it would not check if they are on the same block
+device. The check is introduced by the following commit in v2.31.
+
+https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=67f846b59b32f3d704c601669409c2584383fea9
+
+The here-doc usage in this script creates temporary file in /tmp. When we run in
+an environment where /tmp has rarely been used, the newly created temporary file
+may have a very low inode number. If the inode number was 6 which is the same as
+/dev/null, the as would wrongly think the input file and the output file are the
+same and report the following error.
+
+*** Compiler lacks asm-goto support.. Stop.
+
+One observed case happened in docker where the /tmp could be so rarely used that
+very low number inode may be allocated and triggers the error.
+
+The fix below for the bug only exists on the master branch of binutils so far
+and has not been released from upstream. As the convict is introduced since
+v2.31, only v2.31 is affected.
+
+https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=2a50366ded329bfb39d387253450c9d5302c3503
+
+When building linux-libc-headers we need to use "as" in binutils which does not
+contain the fix for the moment. To work around the error, we create a fixed
+temporary file to contain the program being tested.
+
+This patch also removes ">/dev/null 2>&1" so we will have more direct error
+information in case something else wrong happened.
+
+Upstream-Status: Inappropriate [A work around for binutils v2.31]
+
+Signed-off-by: He Zhe <zhe.he@windriver.com>
+---
+ scripts/gcc-goto.sh | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/scripts/gcc-goto.sh b/scripts/gcc-goto.sh
+index 083c526..0aaf1b4 100755
+--- a/scripts/gcc-goto.sh
++++ b/scripts/gcc-goto.sh
+@@ -3,7 +3,9 @@
+ # Test for gcc 'asm goto' support
+ # Copyright (C) 2010, Jason Baron <jbaron@redhat.com>
+
+-cat << "END" | $@ -x c - -c -o /dev/null >/dev/null 2>&1 && echo "y"
++TMPFILE=`mktemp -p .`
++
++cat << "END" > ${TMPFILE}
+ int main(void)
+ {
+ #if defined(__arm__) || defined(__aarch64__)
+@@ -20,3 +22,6 @@ entry:
+ return 0;
+ }
+ END
++
++$@ -x c ${TMPFILE} -c -o /dev/null && echo "y"
++rm ${TMPFILE}
+--
+2.7.4
+
--git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.18.bb b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.18.bb
index eb7bee7..00420aa 100644
--- a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.18.bb
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.18.bb
@@ -9,5 +9,9 @@ SRC_URI_append_libc-musl = "\
file://0001-include-linux-stddef.h-in-swab.h-uapi-header.patch \
"
+SRC_URI_append = "\
+ file://0001-scripts-Use-fixed-temporary-file-instead-of-pipe-for.patch \
+"
+
SRC_URI[md5sum] = "bee5fe53ee1c3142b8f0c12c0d3348f9"
SRC_URI[sha256sum] = "19d8bcf49ef530cd4e364a45b4a22fa70714b70349c8100e7308488e26f1eaf1"
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* ✗ patchtest: failure for linux-libc-headers: Fix build failure by using fixed temporary file instead of pipe for here-doc
2018-11-21 11:15 [PATCH v2] linux-libc-headers: Fix build failure by using fixed temporary file instead of pipe for here-doc zhe.he
@ 2018-11-21 11:33 ` Patchwork
0 siblings, 0 replies; 2+ messages in thread
From: Patchwork @ 2018-11-21 11:33 UTC (permalink / raw)
To: zhe.he; +Cc: openembedded-core
== Series Details ==
Series: linux-libc-headers: Fix build failure by using fixed temporary file instead of pipe for here-doc
Revision: 1
URL : https://patchwork.openembedded.org/series/15016/
State : failure
== Summary ==
Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:
* Patch [v2] linux-libc-headers: Fix build failure by using fixed temporary file instead of pipe for here-doc
Issue Commit shortlog is too long [test_shortlog_length]
Suggested fix Edit shortlog so that it is 90 characters or less (currently 96 characters)
If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).
---
Guidelines: https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-21 11:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-21 11:15 [PATCH v2] linux-libc-headers: Fix build failure by using fixed temporary file instead of pipe for here-doc zhe.he
2018-11-21 11:33 ` ✗ patchtest: failure for " Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox