<p>Hoernchen has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-trx/+/17800">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">fix libtool issue  with clang and sanitizer<br><br>As pointed out at https://github.com/libexpat/libexpat/issues/312<br>libtool does not play nice with clang sanitizer builds at all.<br>For those builds LD shoud be set to clang too (and LDFLAGS needs the<br>sanitizer flags as well), because the clang compiler driver knows how<br>linking to the sanitizer libs works, but then at a later stage libtool<br>fails to actually produce the shared libraries and the build fails. This<br>is fixed by this patch.<br><br>Addtionally LD_LIBRARY_PATH has no effect on conftest runs during<br>configure time, so the rpath needs to be set to the asan library path to<br>ensure the configure run does not fail due to a missing asan library,<br>i.e.:<br><br>SANS='-fsanitize=memory -fsanitize-recover=all -shared-libsan'<br>export CC=clang-10<br>ASANPATH=$(dirname `$CC -print-file-name=libclang_rt.asan-x86_64.so`)<br>export LDFLAGS="-Wl,-rpath,$ASANPATH $SANS $LDFLAGS"<br><br>Change-Id: If3d9465068b2c654b935fc3d9ab41d799d5e02e8<br>---<br>M configure.ac<br>1 file changed, 5 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/00/17800/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/configure.ac b/configure.ac</span><br><span>index 76c3515..ecf0357 100644</span><br><span>--- a/configure.ac</span><br><span>+++ b/configure.ac</span><br><span>@@ -51,6 +51,11 @@</span><br><span> AC_PATH_PROG([RM_PROG], [rm])</span><br><span> AC_LANG([C++])</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+dnl patching ${archive_cmds} to affect generation of file "libtool" to fix linking with clang (issue #312)</span><br><span style="color: hsl(120, 100%, 40%);">+AS_CASE(["$LD"],[*clang*],</span><br><span style="color: hsl(120, 100%, 40%);">+  [AS_CASE(["${host_os}"],</span><br><span style="color: hsl(120, 100%, 40%);">+     [*linux*],[archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'])])</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> dnl check for pkg-config (explained in detail in libosmocore/configure.ac)</span><br><span> AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no)</span><br><span> if test "x$PKG_CONFIG_INSTALLED" = "xno"; then</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-trx/+/17800">change 17800</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-trx/+/17800"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-trx </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: If3d9465068b2c654b935fc3d9ab41d799d5e02e8 </div>
<div style="display:none"> Gerrit-Change-Number: 17800 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Hoernchen <ewild@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>