<p>Hoernchen has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/17786">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: I2314ef45e6f588e88d5aab8213cc7b5cdef11325<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-mgw refs/changes/86/17786/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 557f2c9..b98b6d2 100644</span><br><span>--- a/configure.ac</span><br><span>+++ b/configure.ac</span><br><span>@@ -22,6 +22,11 @@</span><br><span> AC_PROG_INSTALL</span><br><span> LT_INIT</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-mgw/+/17786">change 17786</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-mgw/+/17786"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-mgw </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I2314ef45e6f588e88d5aab8213cc7b5cdef11325 </div>
<div style="display:none"> Gerrit-Change-Number: 17786 </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>