forked from openembedded/meta-openembedded
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xmlrpc-c: Fix race condition triggered during symlink creation
This should fix race condition sometime seen in highly parallell builds | rm -f libxmlrpc_util.so.4 | rm -f libxmlrpc_util.so.4 | ln -s libxmlrpc_util.so.4.60 libxmlrpc_util.so.4 | ln -s libxmlrpc_util.so.4.60 libxmlrpc_util.so.4 | rm -f libxmlrpc_util.so | ln: failed to create symbolic link 'libxmlrpc_util.so.4': File exists | make[2]: *** [/home/kraj01/yoe/build/tmp/work/core2-64-yoe-linux/xmlrpc-c/1.60.03/git/stable/unix-common.mk:72: libxmlrpc_util.so.4] Error 1 Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Martin Jansa <Martin.Jansa@gmail.com>
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
...evtools/xmlrpc-c/xmlrpc-c/0001-unix-common.mk-Ensuring-Sequential-Execution-of-rm-a.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
From c9bd05e8f0ad805b81625cfa717d06071cfd9b48 Mon Sep 17 00:00:00 2001 | ||
From: Khem Raj <raj.khem@gmail.com> | ||
Date: Wed, 16 Oct 2024 22:52:38 -0700 | ||
Subject: [PATCH] unix-common.mk: Ensuring Sequential Execution of rm and ln commands | ||
|
||
With high parallel execution, it results in race condition where | ||
its trying to create symlink while the original symlink while rm is | ||
not done deleting the existing file yet. | ||
|
||
force sequential execution by adding dependencies between the steps | ||
or combining them into a single shell command | ||
|
||
Here, && ensures that the ln -s command only runs after rm -f target | ||
successfully completes. | ||
|
||
Similar error reported here [1] | ||
|
||
[1] https://bugs.gentoo.org/932835 | ||
|
||
Upstream-Status: Pending | ||
Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
--- | ||
unix-common.mk | 6 ++---- | ||
1 file changed, 2 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/unix-common.mk b/unix-common.mk | ||
index 6954faf5..983c48cd 100644 | ||
--- a/unix-common.mk | ||
+++ b/unix-common.mk | ||
@@ -62,14 +62,12 @@ SHLIB_CMD = $(CCLD) $(LADD) $(LDFLAGS_SHLIB) -o $@ $^ | ||
SHLIB_LE_TARGETS = $(call shliblefn, $(SHARED_LIBS_TO_BUILD)) | ||
|
||
$(SHLIB_LE_TARGETS):%:%.$(MAJ) | ||
- rm -f $@ | ||
- $(LN_S) $< $@ | ||
+ rm -f $@ && $(LN_S) $< $@ | ||
|
||
SONAME_TARGETS = $(SHLIB_LE_TARGETS:%=%.$(MAJ)) | ||
|
||
$(SONAME_TARGETS):%:%.$(MIN) | ||
- rm -f $@ | ||
- $(LN_S) $< $@ | ||
+ rm -f $@ && $(LN_S) $< $@ | ||
|
||
.PHONY: $(SHLIB_INSTALL_TARGETS) | ||
.PHONY: install-shared-libraries |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters