summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0001-unix-common.mk-Ensuring-Sequential-Execution-of-rm-a.patch77
1 files changed, 70 insertions, 7 deletions
diff --git a/meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0001-unix-common.mk-Ensuring-Sequential-Execution-of-rm-a.patch b/meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0001-unix-common.mk-Ensuring-Sequential-Execution-of-rm-a.patch
index 02b5244f3a..152667661e 100644
--- a/meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0001-unix-common.mk-Ensuring-Sequential-Execution-of-rm-a.patch
+++ b/meta-oe/recipes-devtools/xmlrpc-c/xmlrpc-c/0001-unix-common.mk-Ensuring-Sequential-Execution-of-rm-a.patch
@@ -1,23 +1,86 @@
1From c9bd05e8f0ad805b81625cfa717d06071cfd9b48 Mon Sep 17 00:00:00 2001 1From c9bd05e8f0ad805b81625cfa717d06071cfd9b48 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 16 Oct 2024 22:52:38 -0700 3Date: Wed, 16 Oct 2024 22:52:38 -0700
4Subject: [PATCH] unix-common.mk: Ensuring Sequential Execution of rm and ln commands 4Subject: [PATCH] unix-common.mk: Avoid race condition between mutliple make calls running in parallel
5 5
6With high parallel execution, it results in race condition where 6With high parallel execution, it results in race condition where
7its trying to create symlink while the original symlink while rm is 7its trying to create symlink while the original symlink while rm is
8not done deleting the existing file yet. 8not done deleting the existing file yet.
9 9
10force sequential execution by adding dependencies between the steps 10The issue is that submake for libxmlrpc_util.so is called 12 times
11or combining them into a single shell command 11which can run in parallel and then some of them will try to create
12target link at the same time (after both already finished rm call).
12 13
13Here, && ensures that the ln -s command only runs after rm -f target 14Use -f which should be supported even by relatively old ln and
14successfully completes. 15should avoid the need for rm (and hopefully will avoid this race)
16
17For libutil++ it calls "all" and "libxmlrpc_util++.so" only once,
18but for libutil it calls "all" and then 12 times libxmlrpc_util.so
19(after-clean-j1.log is the make output with -n and -j1 instead of
20-j70), still trying to figure out why, my autofoo is rusty :).
21
22Ideally we should prevent calling it 12 times, but until we figure
23out why we can at least avoid the random build failures.
24
25Another interesting fact is that I haven't seen this issue until
26the upgrade to 1.60.03 from 1.59.01 from:
27https://lists.openembedded.org/g/openembedded-devel/message/112706
28but I don't see any changes which should cause this in the git since
291.59.01, but the gentoo bug report is against 1.54.06 already.
30
31martin@jama /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable $ grep -A 1 lib/libutil++/Makefile after-clean-j1.log
32make -C libutil++/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil++/Makefile \
33 all
34--
35make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil++/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil++/Makefile \
36 libxmlrpc_util++.so
37
38martin@jama /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable $ grep -A 1 lib/libutil/Makefile after-clean-j1.log
39make -C libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \
40 all
41--
42make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \
43 libxmlrpc_util.so
44--
45make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \
46 libxmlrpc_util.so
47--
48make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \
49 libxmlrpc_util.so
50--
51make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \
52 libxmlrpc_util.so
53--
54make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \
55 libxmlrpc_util.so
56--
57make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \
58 libxmlrpc_util.so
59--
60make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \
61 libxmlrpc_util.so
62--
63make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \
64 libxmlrpc_util.so
65--
66make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \
67 libxmlrpc_util.so
68--
69make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \
70 libxmlrpc_util.so
71--
72make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \
73 libxmlrpc_util.so
74--
75make -C /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/ -f /OE/build/oe-core/tmp/work/core2-64-oe-linux/xmlrpc-c/1.60.03/git/stable/lib/libutil/Makefile \
76 libxmlrpc_util.so
15 77
16Similar error reported here [1] 78Similar error reported here [1]
17 79
18[1] https://bugs.gentoo.org/932835 80[1] https://bugs.gentoo.org/932835
19 81
20Upstream-Status: Pending 82Upstream-Status: Pending
83Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
21Signed-off-by: Khem Raj <raj.khem@gmail.com> 84Signed-off-by: Khem Raj <raj.khem@gmail.com>
22--- 85---
23 unix-common.mk | 6 ++---- 86 unix-common.mk | 6 ++----
@@ -33,14 +96,14 @@ index 6954faf5..983c48cd 100644
33 $(SHLIB_LE_TARGETS):%:%.$(MAJ) 96 $(SHLIB_LE_TARGETS):%:%.$(MAJ)
34- rm -f $@ 97- rm -f $@
35- $(LN_S) $< $@ 98- $(LN_S) $< $@
36+ rm -f $@ && $(LN_S) $< $@ 99+ $(LN_S) -f $< $@
37 100
38 SONAME_TARGETS = $(SHLIB_LE_TARGETS:%=%.$(MAJ)) 101 SONAME_TARGETS = $(SHLIB_LE_TARGETS:%=%.$(MAJ))
39 102
40 $(SONAME_TARGETS):%:%.$(MIN) 103 $(SONAME_TARGETS):%:%.$(MIN)
41- rm -f $@ 104- rm -f $@
42- $(LN_S) $< $@ 105- $(LN_S) $< $@
43+ rm -f $@ && $(LN_S) $< $@ 106+ $(LN_S) -f $< $@
44 107
45 .PHONY: $(SHLIB_INSTALL_TARGETS) 108 .PHONY: $(SHLIB_INSTALL_TARGETS)
46 .PHONY: install-shared-libraries 109 .PHONY: install-shared-libraries