<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14395">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
Kevin Harwell: Looks good to me, approved
George Joseph: Looks good to me, but someone else must approve
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pjproject: Fix race condition when building with parallel make<br><br>Pjproject makefiles miss some dependencies which can cause race<br>conditions when building with parallel make processes. This patch<br>adds such dependencies correctly.<br><br>ASTERISK-28879 #close<br>Reported-by: Dmitry Wagin <dmitry.wagin@ya.ru><br><br>Change-Id: Ie1b0dc365dafe4a84c5248097fe8d73804043c22<br>---<br>A third-party/pjproject/patches/0050-fix-race-parallel-build.patch<br>1 file changed, 72 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/third-party/pjproject/patches/0050-fix-race-parallel-build.patch b/third-party/pjproject/patches/0050-fix-race-parallel-build.patch</span><br><span>new file mode 100644</span><br><span>index 0000000..674baa2</span><br><span>--- /dev/null</span><br><span>+++ b/third-party/pjproject/patches/0050-fix-race-parallel-build.patch</span><br><span>@@ -0,0 +1,72 @@</span><br><span style="color: hsl(120, 100%, 40%);">+From 78683646c8bc670ec730a42494e075f671a08e28 Mon Sep 17 00:00:00 2001</span><br><span style="color: hsl(120, 100%, 40%);">+From: Guido Falsi <mad@madpilot.net></span><br><span style="color: hsl(120, 100%, 40%);">+Date: Mon, 11 May 2020 08:50:39 +0200</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: [PATCH] Fix race condition in parallel builds (#2426)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+* Some targets residing in `OBJDIRS` are missing a dependency on that directory, which results in a race condition, causing build to fail sometimes due to the directory not existing when running parallel builds.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+* The `PJSUA_LIB` variable is not defined anywhere, resulting in an empty value, and no correct dependency on the pjsua shared library for `pjsua2`. The correct variable seems to be `PJSUA_LIB_LIB`, defined at the start of this same `Makefile`.</span><br><span style="color: hsl(120, 100%, 40%);">+---</span><br><span style="color: hsl(120, 100%, 40%);">+ build/rules.mak | 12 ++++++------</span><br><span style="color: hsl(120, 100%, 40%);">+ pjsip/build/Makefile | 2 +-</span><br><span style="color: hsl(120, 100%, 40%);">+ 2 files changed, 7 insertions(+), 7 deletions(-)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+diff --git a/build/rules.mak b/build/rules.mak</span><br><span style="color: hsl(120, 100%, 40%);">+index 8fa98655e..912199c41 100644</span><br><span style="color: hsl(120, 100%, 40%);">+--- a/build/rules.mak</span><br><span>++++ b/build/rules.mak</span><br><span style="color: hsl(120, 100%, 40%);">+@@ -129,7 +129,7 @@ endif</span><br><span style="color: hsl(120, 100%, 40%);">+ $(OBJDIR)/$(app).o: $(OBJDIRS) $(OBJS)</span><br><span style="color: hsl(120, 100%, 40%);">+ $(CROSS_COMPILE)ld -r -o $@ $(OBJS)</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+-$(OBJDIR)/$(app).ko: $(OBJDIR)/$(app).o</span><br><span style="color: hsl(120, 100%, 40%);">++$(OBJDIR)/$(app).ko: $(OBJDIR)/$(app).o | $(OBJDIRS)</span><br><span style="color: hsl(120, 100%, 40%);">+ @echo Creating kbuild Makefile...</span><br><span style="color: hsl(120, 100%, 40%);">+ @echo "# Our module name:" > $(OBJDIR)/Makefile</span><br><span style="color: hsl(120, 100%, 40%);">+ @echo 'obj-m += $(app).o' >> $(OBJDIR)/Makefile</span><br><span style="color: hsl(120, 100%, 40%);">+@@ -154,27 +154,27 @@ $(OBJDIR)/$(app).ko: $(OBJDIR)/$(app).o</span><br><span style="color: hsl(120, 100%, 40%);">+ ../lib/$(app).ko: $(LIB) $(OBJDIR)/$(app).ko</span><br><span style="color: hsl(120, 100%, 40%);">+ cp $(OBJDIR)/$(app).ko ../lib</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+-$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.m</span><br><span style="color: hsl(120, 100%, 40%);">++$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.m | $(OBJDIRS)</span><br><span style="color: hsl(120, 100%, 40%);">+ $(CC) $($(APP)_CFLAGS) \</span><br><span style="color: hsl(120, 100%, 40%);">+ $(CC_OUT)$(subst /,$(HOST_PSEP),$@) \</span><br><span style="color: hsl(120, 100%, 40%);">+ $(subst /,$(HOST_PSEP),$<) </span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+-$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.c</span><br><span style="color: hsl(120, 100%, 40%);">++$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.c | $(OBJDIRS)</span><br><span style="color: hsl(120, 100%, 40%);">+ $(CC) $($(APP)_CFLAGS) \</span><br><span style="color: hsl(120, 100%, 40%);">+ $(CC_OUT)$(subst /,$(HOST_PSEP),$@) \</span><br><span style="color: hsl(120, 100%, 40%);">+ $(subst /,$(HOST_PSEP),$<) </span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+-$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.S</span><br><span style="color: hsl(120, 100%, 40%);">++$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.S | $(OBJDIRS)</span><br><span style="color: hsl(120, 100%, 40%);">+ $(CC) $($(APP)_CFLAGS) \</span><br><span style="color: hsl(120, 100%, 40%);">+ $(CC_OUT)$(subst /,$(HOST_PSEP),$@) \</span><br><span style="color: hsl(120, 100%, 40%);">+ $(subst /,$(HOST_PSEP),$<) </span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+-$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.cpp</span><br><span style="color: hsl(120, 100%, 40%);">++$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.cpp | $(OBJDIRS)</span><br><span style="color: hsl(120, 100%, 40%);">+ $(CXX) $($(APP)_CXXFLAGS) \</span><br><span style="color: hsl(120, 100%, 40%);">+ $(CC_OUT)$(subst /,$(HOST_PSEP),$@) \</span><br><span style="color: hsl(120, 100%, 40%);">+ $(subst /,$(HOST_PSEP),$<)</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+-$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.cc</span><br><span style="color: hsl(120, 100%, 40%);">++$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.cc | $(OBJDIRS)</span><br><span style="color: hsl(120, 100%, 40%);">+ $(CXX) $($(APP)_CXXFLAGS) \</span><br><span style="color: hsl(120, 100%, 40%);">+ $(CC_OUT)$(subst /,$(HOST_PSEP),$@) \</span><br><span style="color: hsl(120, 100%, 40%);">+ $(subst /,$(HOST_PSEP),$<)</span><br><span style="color: hsl(120, 100%, 40%);">+diff --git a/pjsip/build/Makefile b/pjsip/build/Makefile</span><br><span style="color: hsl(120, 100%, 40%);">+index b85c7817a..20777909f 100644</span><br><span style="color: hsl(120, 100%, 40%);">+--- a/pjsip/build/Makefile</span><br><span>++++ b/pjsip/build/Makefile</span><br><span style="color: hsl(120, 100%, 40%);">+@@ -262,7 +262,7 @@ $(PJSUA_LIB_LIB) $(PJSUA_LIB_SONAME): $(PJSIP_LIB) $(PJSIP_SONAME) $(PJSIP_SIMPL</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ pjsua2-lib: $(PJSUA2_LIB_LIB)</span><br><span style="color: hsl(120, 100%, 40%);">+ $(PJSUA2_LIB_SONAME): $(PJSUA2_LIB_LIB)</span><br><span style="color: hsl(120, 100%, 40%);">+-$(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)</span><br><span style="color: hsl(120, 100%, 40%);">++$(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)</span><br><span style="color: hsl(120, 100%, 40%);">+ $(MAKE) -f $(RULES_MAK) APP=PJSUA2_LIB app=pjsua2-lib $(subst /,$(HOST_PSEP),$(LIBDIR)/$@)</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ pjsip-test: $(TEST_EXE)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/14395">change 14395</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/14395"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 17 </div>
<div style="display:none"> Gerrit-Change-Id: Ie1b0dc365dafe4a84c5248097fe8d73804043c22 </div>
<div style="display:none"> Gerrit-Change-Number: 14395 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Guido Falsi <madpilot@freebsd.org> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>