diff options
-rw-r--r-- | recipes-extended/dev86/dev86/0001-cpp-fix-race-writing-token.h-files.patch | 42 | ||||
-rw-r--r-- | recipes-extended/dev86/dev86/cross.patch | 2 | ||||
-rw-r--r-- | recipes-extended/dev86/dev86_git.bb | 3 |
3 files changed, 45 insertions, 2 deletions
diff --git a/recipes-extended/dev86/dev86/0001-cpp-fix-race-writing-token.h-files.patch b/recipes-extended/dev86/dev86/0001-cpp-fix-race-writing-token.h-files.patch new file mode 100644 index 00000000..d6e79999 --- /dev/null +++ b/recipes-extended/dev86/dev86/0001-cpp-fix-race-writing-token.h-files.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | Upstream-Status: Submitted [https://github.com/jbruchon/dev86/pull/23] | ||
2 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
3 | |||
4 | From f507ee398ae20e4e97f01dfbd9a8709a90bc760f Mon Sep 17 00:00:00 2001 | ||
5 | From: Ross Burton <ross.burton@arm.com> | ||
6 | Date: Fri, 29 Apr 2022 16:44:08 +0100 | ||
7 | Subject: [PATCH] cpp: fix race writing token.h files | ||
8 | |||
9 | The rules for token1.h and token2.h both write to a temporary file tmp.h | ||
10 | before renaming to token1.h or token2.h. However, in a parallel build | ||
11 | these will execute at the same time and race. | ||
12 | |||
13 | gperf -aptTc -N is_ctok -H hash1 token1.tok > tmp.h | ||
14 | gperf -aptTc -k1,3 -N is_ckey -H hash2 token2.tok > tmp.h | ||
15 | mv tmp.h token1.h | ||
16 | mv tmp.h token2.h | ||
17 | mv: cannot stat 'tmp.h': No such file or directory | ||
18 | |||
19 | By using gperf --output-file, the race is avoided entirely. | ||
20 | --- | ||
21 | cpp/Makefile | 6 ++---- | ||
22 | 1 file changed, 2 insertions(+), 4 deletions(-) | ||
23 | |||
24 | diff --git a/cpp/Makefile b/cpp/Makefile | ||
25 | index 0ea43cc..743694f 100644 | ||
26 | --- a/cpp/Makefile | ||
27 | +++ b/cpp/Makefile | ||
28 | @@ -20,9 +20,7 @@ token1.o: token1.h | ||
29 | token2.o: token2.h | ||
30 | |||
31 | token1.h: token1.tok | ||
32 | - gperf -aptTc -N is_ctok -H hash1 token1.tok > tmp.h | ||
33 | - mv tmp.h token1.h | ||
34 | + gperf -aptTc -N is_ctok -H hash1 --output-file $@ $< | ||
35 | |||
36 | token2.h: token2.tok | ||
37 | - gperf -aptTc -k1,3 -N is_ckey -H hash2 token2.tok > tmp.h | ||
38 | - mv tmp.h token2.h | ||
39 | + gperf -aptTc -k1,3 -N is_ckey -H hash2 --output-file $@ $< | ||
40 | -- | ||
41 | 2.25.1 | ||
42 | |||
diff --git a/recipes-extended/dev86/dev86/cross.patch b/recipes-extended/dev86/dev86/cross.patch index 041a8d31..fd62c5dd 100644 --- a/recipes-extended/dev86/dev86/cross.patch +++ b/recipes-extended/dev86/dev86/cross.patch | |||
@@ -1,6 +1,6 @@ | |||
1 | Build ifdef using BUILD_CC, not CC. | 1 | Build ifdef using BUILD_CC, not CC. |
2 | 2 | ||
3 | Upstream-Status: Pending | 3 | Upstream-Status: Submitted [https://github.com/jbruchon/dev86/pull/22] |
4 | Signed-off-by: Ross Burton <ross.burton@arm.com> | 4 | Signed-off-by: Ross Burton <ross.burton@arm.com> |
5 | 5 | ||
6 | diff --git a/Makefile b/Makefile | 6 | diff --git a/Makefile b/Makefile |
diff --git a/recipes-extended/dev86/dev86_git.bb b/recipes-extended/dev86/dev86_git.bb index 4b5a2654..82f43a08 100644 --- a/recipes-extended/dev86/dev86_git.bb +++ b/recipes-extended/dev86/dev86_git.bb | |||
@@ -11,7 +11,8 @@ SRC_URI = "git://github.com/jbruchon/${BPN}.git;protocol=https;branch=master \ | |||
11 | file://0001-cpp-Makefile-respect-LDFLAGS-when-building-bcc-cpp.patch \ | 11 | file://0001-cpp-Makefile-respect-LDFLAGS-when-building-bcc-cpp.patch \ |
12 | file://0003-cpp-update-token1.tok-to-make-new-gperf-happy-regen..patch \ | 12 | file://0003-cpp-update-token1.tok-to-make-new-gperf-happy-regen..patch \ |
13 | file://0004-regen-token2.h-token1.h-with-gperf-3.1.patch \ | 13 | file://0004-regen-token2.h-token1.h-with-gperf-3.1.patch \ |
14 | file://cross.patch \ | 14 | file://cross.patch \ |
15 | file://0001-cpp-fix-race-writing-token.h-files.patch \ | ||
15 | " | 16 | " |
16 | 17 | ||
17 | S = "${WORKDIR}/git" | 18 | S = "${WORKDIR}/git" |