[Asterisk-code-review] pjproject: Fix race condition when building with parallel make (asterisk[13])
Guido Falsi
asteriskteam at digium.com
Fri May 8 06:14:16 CDT 2020
Guido Falsi has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/14401 )
Change subject: pjproject: Fix race condition when building with parallel make
......................................................................
pjproject: Fix race condition when building with parallel make
Pjproject makefiles miss some dependencies which can cause race
conditions when building with parallel make processes. This patch
adds such dependencies correctly.
ASTERISK-28879 #close
Reported-by: Dmitry Wagin <dmitry.wagin at ya.ru>
Change-Id: Ie1b0dc365dafe4a84c5248097fe8d73804043c22
---
A third-party/pjproject/patches/0050-fix-race-parallel-build.patch
1 file changed, 59 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/01/14401/1
diff --git a/third-party/pjproject/patches/0050-fix-race-parallel-build.patch b/third-party/pjproject/patches/0050-fix-race-parallel-build.patch
new file mode 100644
index 0000000..da8ff86
--- /dev/null
+++ b/third-party/pjproject/patches/0050-fix-race-parallel-build.patch
@@ -0,0 +1,59 @@
+diff --git a/build/rules.mak b/build/rules.mak
+index 8fa98655e..912199c41 100644
+--- a/build/rules.mak
++++ b/build/rules.mak
+@@ -129,7 +129,7 @@ endif
+ $(OBJDIR)/$(app).o: $(OBJDIRS) $(OBJS)
+ $(CROSS_COMPILE)ld -r -o $@ $(OBJS)
+
+-$(OBJDIR)/$(app).ko: $(OBJDIR)/$(app).o
++$(OBJDIR)/$(app).ko: $(OBJDIR)/$(app).o | $(OBJDIRS)
+ @echo Creating kbuild Makefile...
+ @echo "# Our module name:" > $(OBJDIR)/Makefile
+ @echo 'obj-m += $(app).o' >> $(OBJDIR)/Makefile
+@@ -154,27 +154,27 @@ $(OBJDIR)/$(app).ko: $(OBJDIR)/$(app).o
+ ../lib/$(app).ko: $(LIB) $(OBJDIR)/$(app).ko
+ cp $(OBJDIR)/$(app).ko ../lib
+
+-$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.m
++$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.m | $(OBJDIRS)
+ $(CC) $($(APP)_CFLAGS) \
+ $(CC_OUT)$(subst /,$(HOST_PSEP),$@) \
+ $(subst /,$(HOST_PSEP),$<)
+
+-$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.c
++$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.c | $(OBJDIRS)
+ $(CC) $($(APP)_CFLAGS) \
+ $(CC_OUT)$(subst /,$(HOST_PSEP),$@) \
+ $(subst /,$(HOST_PSEP),$<)
+
+-$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.S
++$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.S | $(OBJDIRS)
+ $(CC) $($(APP)_CFLAGS) \
+ $(CC_OUT)$(subst /,$(HOST_PSEP),$@) \
+ $(subst /,$(HOST_PSEP),$<)
+
+-$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.cpp
++$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.cpp | $(OBJDIRS)
+ $(CXX) $($(APP)_CXXFLAGS) \
+ $(CC_OUT)$(subst /,$(HOST_PSEP),$@) \
+ $(subst /,$(HOST_PSEP),$<)
+
+-$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.cc
++$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.cc | $(OBJDIRS)
+ $(CXX) $($(APP)_CXXFLAGS) \
+ $(CC_OUT)$(subst /,$(HOST_PSEP),$@) \
+ $(subst /,$(HOST_PSEP),$<)
+diff --git a/pjsip/build/Makefile b/pjsip/build/Makefile
+index b85c7817a..20777909f 100644
+--- a/pjsip/build/Makefile
++++ b/pjsip/build/Makefile
+@@ -262,7 +262,7 @@ $(PJSUA_LIB_LIB) $(PJSUA_LIB_SONAME): $(PJSIP_LIB) $(PJSIP_SONAME) $(PJSIP_SIMPL
+
+ pjsua2-lib: $(PJSUA2_LIB_LIB)
+ $(PJSUA2_LIB_SONAME): $(PJSUA2_LIB_LIB)
+-$(PJSUA2_LIB_LIB) $(PJSUA2_LIB_SONAME): $(PJSUA_LIB) $(PSJUA_LIB_SONAME) $(PJSIP_LIB) $(PJSIP_SONAME) $(PJSIP_SIMPLE_LIB) $(PJSIP_SIMPLE_SONAME) $(PJSIP_UA_LIB) $(PJSIP_UA_SONAME)
++$(PJSUA2_LIB_LIB) $(PJSUA2_LIB_SONAME): $(PJSUA_LIB_LIB) $(PJSUA_LIB_SONAME) $(PJSIP_LIB) $(PJSIP_SONAME) $(PJSIP_SIMPLE_LIB) $(PJSIP_SIMPLE_SONAME) $(PJSIP_UA_LIB) $(PJSIP_UA_SONAME)
+ $(MAKE) -f $(RULES_MAK) APP=PJSUA2_LIB app=pjsua2-lib $(subst /,$(HOST_PSEP),$(LIBDIR)/$@)
+
+ pjsip-test: $(TEST_EXE)
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/14401
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: Ie1b0dc365dafe4a84c5248097fe8d73804043c22
Gerrit-Change-Number: 14401
Gerrit-PatchSet: 1
Gerrit-Owner: Guido Falsi <madpilot at freebsd.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200508/3d4bfed9/attachment.html>
More information about the asterisk-code-review
mailing list