summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2021-07-22 16:39:16 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-10 11:14:11 +0100
commit08d1a1313c515ab5aa0984de979b0034b7569962 (patch)
tree3f772d89b669890bc0d88ebfa5714d3d7c4ee8cc /meta/recipes-graphics
parentaabe9c0f70ea9217a4fadbcca34d1b5331dd7a10 (diff)
downloadpoky-08d1a1313c515ab5aa0984de979b0034b7569962.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: 098e9a98ef31211d9a217ab1fde4655b81a7b56d) 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: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics')
-rw-r--r--meta/recipes-graphics/glew/glew/0001-Fix-build-race-in-Makefile.patch56
-rw-r--r--meta/recipes-graphics/glew/glew_2.2.0.bb1
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 @@
1Upstream-Status: Submitted [https://github.com/nigels-com/glew/pull/311]
2Signed-off-by: Ross Burton <ross.burton@arm.com>
3
4From 0ce0a85597db48a2fca619bd95e34af091e54ae8 Mon Sep 17 00:00:00 2001
5From: Ross Burton <ross.burton@arm.com>
6Date: Thu, 22 Jul 2021 16:31:11 +0100
7Subject: [PATCH] Fix build race in Makefile
8
9The current rule for the binaries is:
10
11glew.bin: glew.lib bin bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN)
12
13In parallel builds, all of those targets happen at the same time. This
14means that 'bin' can happen *after* 'bin/$(GLEWINFO.BIN)', which is a
15problem as the 'bin' target's responsibility is to create the directory
16that the other target writes into.
17
18Solve this by not having a separate 'create directory' target which is
19fundamentally racy, and simply mkdir in each target which writes into it.
20---
21 Makefile | 9 ++++-----
22 1 file changed, 4 insertions(+), 5 deletions(-)
23
24diff --git a/Makefile b/Makefile
25index 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--
552.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"
6LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=2ac251558de685c6b9478d89be3149c2" 6LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=2ac251558de685c6b9478d89be3149c2"
7 7
8SRC_URI = "${SOURCEFORGE_MIRROR}/project/glew/glew/${PV}/glew-${PV}.tgz \ 8SRC_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
11SRC_URI[md5sum] = "3579164bccaef09e36c0af7f4fd5c7c7" 12SRC_URI[md5sum] = "3579164bccaef09e36c0af7f4fd5c7c7"