summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/glew/glew/0001-Fix-build-race-in-Makefile.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-graphics/glew/glew/0001-Fix-build-race-in-Makefile.patch')
-rw-r--r--meta/recipes-graphics/glew/glew/0001-Fix-build-race-in-Makefile.patch56
1 files changed, 56 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..2418646689
--- /dev/null
+++ b/meta/recipes-graphics/glew/glew/0001-Fix-build-race-in-Makefile.patch
@@ -0,0 +1,56 @@
1Upstream-Status: Backport [767e0316450911f1158bd4f7fd8dcd066bae5c55]
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