<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/20389">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  pespin: Looks good to me, but someone else must approve
  fixeria: Looks good to me, approved
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bts.cpp: Increase constructor priority<br><br>It seems that some gcc versions do not consider the priority of<br>"C" __attribute__((constructor)) definitions in the same order as<br>they do C++ static initializers, which are called in the order in which<br>they appear in the compile unit (source file).<br><br>The problem has been observed at least in a<br>environment based on T2 SDE with GCC 6.3.0 and binutils 2.28.<br><br>Let's work around this by making sure the __attribute__((constructor))<br>function always gets the highest priority value permitted by gcc (101).<br><br>Closes: SYS#5093<br>Change-Id: I65de69a32ac929e6ddd4e58980027f9e76813153<br>---<br>M src/bts.cpp<br>1 file changed, 1 insertion(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/bts.cpp b/src/bts.cpp</span><br><span>index 5cd2b1d..da62b30 100644</span><br><span>--- a/src/bts.cpp</span><br><span>+++ b/src/bts.cpp</span><br><span>@@ -59,7 +59,7 @@</span><br><span>      /* e must make sure to initialize logging before the BTS static</span><br><span>       * constructors are executed below, as those call libosmocore APIs that</span><br><span>       * require logging already to be initialized. */</span><br><span style="color: hsl(0, 100%, 40%);">-        __attribute__((constructor)) static void early_init(void)</span><br><span style="color: hsl(120, 100%, 40%);">+     __attribute__((constructor (101))) static void early_init(void)</span><br><span>      {</span><br><span>            if (!tall_pcu_ctx) {</span><br><span>                         tall_pcu_ctx = talloc_named_const(NULL, 1, "Osmo-PCU context");</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-pcu/+/20389">change 20389</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.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.osmocom.org/c/osmo-pcu/+/20389"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-pcu </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I65de69a32ac929e6ddd4e58980027f9e76813153 </div>
<div style="display:none"> Gerrit-Change-Number: 20389 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>