diff options
Diffstat (limited to 'meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-scripts-Use-fixed-input-and-output-files-instead-of-.patch')
-rw-r--r-- | meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-scripts-Use-fixed-input-and-output-files-instead-of-.patch | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-scripts-Use-fixed-input-and-output-files-instead-of-.patch b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-scripts-Use-fixed-input-and-output-files-instead-of-.patch new file mode 100644 index 0000000000..9ba1c076e8 --- /dev/null +++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-scripts-Use-fixed-input-and-output-files-instead-of-.patch | |||
@@ -0,0 +1,68 @@ | |||
1 | From 694eba7bb974f6b8bd308804cb24350150108b2b Mon Sep 17 00:00:00 2001 | ||
2 | From: He Zhe <zhe.he@windriver.com> | ||
3 | Date: Wed, 21 Nov 2018 15:12:43 +0800 | ||
4 | Subject: [PATCH] scripts: Use fixed input and output files instead of pipe for | ||
5 | here-doc | ||
6 | |||
7 | There was a bug of "as" in binutils that when it checks if the input file and | ||
8 | output file are the same one, it would not check if they are on the same block | ||
9 | device. The check is introduced by the following commit in v2.31. | ||
10 | |||
11 | https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h= | ||
12 | 67f846b59b32f3d704c601669409c2584383fea9 | ||
13 | |||
14 | The here-doc usage in this script creates temporary file in /tmp. When we run in | ||
15 | an environment where /tmp has rarely been used, the newly created temporary file | ||
16 | may have a very low inode number. If the inode number was 6 which is the same as | ||
17 | /dev/null, the as would wrongly think the input file and the output file are the | ||
18 | same and report the following error. | ||
19 | |||
20 | *** Compiler lacks asm-goto support.. Stop. | ||
21 | |||
22 | One observed case happened in docker where the /tmp could be so rarely used that | ||
23 | very low number inode may be allocated and triggers the error. | ||
24 | |||
25 | The fix below for the bug only exists on the master branch of binutils so far | ||
26 | and has not been released from upstream. As the convict is introduced since | ||
27 | v2.31, only v2.31 is affected. | ||
28 | |||
29 | https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h= | ||
30 | 2a50366ded329bfb39d387253450c9d5302c3503 | ||
31 | |||
32 | When building linux-libc-headers we need to use "as" in binutils which does not | ||
33 | contain the fix for the moment. To work around the error, we create a fixed | ||
34 | temporary file to contain the program being tested. | ||
35 | |||
36 | This patch also removes ">/dev/null 2>&1" so we will have more direct error | ||
37 | information in case something else wrong happened. | ||
38 | |||
39 | Upstream-Status: Inappropriate [A work around for binutils v2.31] | ||
40 | |||
41 | Signed-off-by: He Zhe <zhe.he@windriver.com> | ||
42 | --- | ||
43 | scripts/gcc-goto.sh | 5 ++++- | ||
44 | 1 file changed, 4 insertions(+), 1 deletion(-) | ||
45 | |||
46 | diff --git a/scripts/gcc-goto.sh b/scripts/gcc-goto.sh | ||
47 | index 083c526..8dfac55 100755 | ||
48 | --- a/scripts/gcc-goto.sh | ||
49 | +++ b/scripts/gcc-goto.sh | ||
50 | @@ -3,7 +3,7 @@ | ||
51 | # Test for gcc 'asm goto' support | ||
52 | # Copyright (C) 2010, Jason Baron <jbaron@redhat.com> | ||
53 | |||
54 | -cat << "END" | $@ -x c - -c -o /dev/null >/dev/null 2>&1 && echo "y" | ||
55 | +cat << "END" > ./input | ||
56 | int main(void) | ||
57 | { | ||
58 | #if defined(__arm__) || defined(__aarch64__) | ||
59 | @@ -20,3 +20,6 @@ entry: | ||
60 | return 0; | ||
61 | } | ||
62 | END | ||
63 | + | ||
64 | +$@ -x c ./input -c -o ./output && echo "y" | ||
65 | +rm ./input ./output | ||
66 | -- | ||
67 | 2.7.4 | ||
68 | |||