diff options
author | Ross Burton <ross@burtonini.com> | 2021-07-22 16:39:16 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-08-06 09:59:14 +0100 |
commit | 8f3fafc0d8676f86e0b826c868c465f9955bc683 (patch) | |
tree | c1411b5f18659a512199245b5e8fa2628b3c3117 /meta | |
parent | 8e542187575a3b0c27781a006645ec1b514e5380 (diff) | |
download | poky-8f3fafc0d8676f86e0b826c868c465f9955bc683.tar.gz |
glew: fix Makefile race
Fix a Makefile race resulting in the target creating a directory being
executed after the target to write into that directory.
[ YOCTO #14485 ]
(From OE-Core rev: caa34b782a4e7d14dabf5a14cc3fb147509cc716)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit e90c1d3b80e35fb685d4b321972743771eb2c2c0)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-graphics/glew/glew/0001-Fix-build-race-in-Makefile.patch | 56 | ||||
-rw-r--r-- | meta/recipes-graphics/glew/glew_2.2.0.bb | 1 |
2 files changed, 57 insertions, 0 deletions
diff --git a/meta/recipes-graphics/glew/glew/0001-Fix-build-race-in-Makefile.patch b/meta/recipes-graphics/glew/glew/0001-Fix-build-race-in-Makefile.patch new file mode 100644 index 0000000000..7edcfe8de8 --- /dev/null +++ b/meta/recipes-graphics/glew/glew/0001-Fix-build-race-in-Makefile.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | Upstream-Status: Submitted [https://github.com/nigels-com/glew/pull/311] | ||
2 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
3 | |||
4 | From 0ce0a85597db48a2fca619bd95e34af091e54ae8 Mon Sep 17 00:00:00 2001 | ||
5 | From: Ross Burton <ross.burton@arm.com> | ||
6 | Date: Thu, 22 Jul 2021 16:31:11 +0100 | ||
7 | Subject: [PATCH] Fix build race in Makefile | ||
8 | |||
9 | The current rule for the binaries is: | ||
10 | |||
11 | glew.bin: glew.lib bin bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN) | ||
12 | |||
13 | In parallel builds, all of those targets happen at the same time. This | ||
14 | means that 'bin' can happen *after* 'bin/$(GLEWINFO.BIN)', which is a | ||
15 | problem as the 'bin' target's responsibility is to create the directory | ||
16 | that the other target writes into. | ||
17 | |||
18 | Solve this by not having a separate 'create directory' target which is | ||
19 | fundamentally racy, and simply mkdir in each target which writes into it. | ||
20 | --- | ||
21 | Makefile | 9 ++++----- | ||
22 | 1 file changed, 4 insertions(+), 5 deletions(-) | ||
23 | |||
24 | diff --git a/Makefile b/Makefile | ||
25 | index d0e4614..04af44c 100644 | ||
26 | --- a/Makefile | ||
27 | +++ b/Makefile | ||
28 | @@ -171,21 +171,20 @@ VISUALINFO.BIN.OBJ := $(VISUALINFO.BIN.OBJ:.c=.o) | ||
29 | # Don't build glewinfo or visualinfo for NaCL, yet. | ||
30 | |||
31 | ifneq ($(filter nacl%,$(SYSTEM)),) | ||
32 | -glew.bin: glew.lib bin | ||
33 | +glew.bin: glew.lib | ||
34 | else | ||
35 | -glew.bin: glew.lib bin bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN) | ||
36 | +glew.bin: glew.lib bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN) | ||
37 | endif | ||
38 | |||
39 | -bin: | ||
40 | - mkdir bin | ||
41 | - | ||
42 | bin/$(GLEWINFO.BIN): $(GLEWINFO.BIN.OBJ) $(LIB.SHARED.DIR)/$(LIB.SHARED) | ||
43 | + @mkdir -p $(dir $@) | ||
44 | $(CC) $(CFLAGS) -o $@ $(GLEWINFO.BIN.OBJ) $(BIN.LIBS) | ||
45 | ifneq ($(STRIP),) | ||
46 | $(STRIP) -x $@ | ||
47 | endif | ||
48 | |||
49 | bin/$(VISUALINFO.BIN): $(VISUALINFO.BIN.OBJ) $(LIB.SHARED.DIR)/$(LIB.SHARED) | ||
50 | + @mkdir -p $(dir $@) | ||
51 | $(CC) $(CFLAGS) -o $@ $(VISUALINFO.BIN.OBJ) $(BIN.LIBS) | ||
52 | ifneq ($(STRIP),) | ||
53 | $(STRIP) -x $@ | ||
54 | -- | ||
55 | 2.25.1 | ||
56 | |||
diff --git a/meta/recipes-graphics/glew/glew_2.2.0.bb b/meta/recipes-graphics/glew/glew_2.2.0.bb index 8948444e08..92b6083648 100644 --- a/meta/recipes-graphics/glew/glew_2.2.0.bb +++ b/meta/recipes-graphics/glew/glew_2.2.0.bb | |||
@@ -6,6 +6,7 @@ LICENSE = "MIT" | |||
6 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=2ac251558de685c6b9478d89be3149c2" | 6 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=2ac251558de685c6b9478d89be3149c2" |
7 | 7 | ||
8 | SRC_URI = "${SOURCEFORGE_MIRROR}/project/glew/glew/${PV}/glew-${PV}.tgz \ | 8 | SRC_URI = "${SOURCEFORGE_MIRROR}/project/glew/glew/${PV}/glew-${PV}.tgz \ |
9 | file://0001-Fix-build-race-in-Makefile.patch \ | ||
9 | file://no-strip.patch" | 10 | file://no-strip.patch" |
10 | 11 | ||
11 | SRC_URI[md5sum] = "3579164bccaef09e36c0af7f4fd5c7c7" | 12 | SRC_URI[md5sum] = "3579164bccaef09e36c0af7f4fd5c7c7" |