Hi Bernd,

On 11.01.16 19:28, Bernd Schmidt wrote:
On 11/10/2015 11:00 PM, Andreas Tobler wrote:
the attached patch removes the hard-coded requirement for the link
operation with -ldl. On FreeBSD we do not need that, it breaks compilation.


   # Common libraries that we need to link against for all sanitizer libs.
-link_sanitizer_common='-lpthread -ldl -lm'
+link_sanitizer_common='-lpthread -lm'

   # At least for glibc, shm_open is in librt.  But don't pull that
   # in if it still doesn't give us the function we want.  This
@@ -130,6 +130,12 @@
   # Other sanitizers do not override clock_* API
   ])

+# Do a configure time check for -ldl
+AC_CHECK_LIB(dl, dlsym,
+  [link_libasan="-ldl $link_libasan"
+link_libtsan="-ldl $link_libtsan"
+])
+

Why not add this to link_sanitizer_common, just after the similar check
for shm_open? I'm not entirely sure how libsanitizer is structured, but
I see references to dlsym inside the sanitizer_common directory.

Hm, looks simpler, yes.

@@ -104,6 +104,10 @@
 AC_CHECK_LIB(rt, shm_open,
   [link_sanitizer_common="-lrt $link_sanitizer_common"])

+# Do a configure time check for -ldl
+AC_CHECK_LIB(dl, dlsym,
+  [link_sanitizer_common="-lrt $link_sanitizer_common"])
+

I'll give it a test run.

Thanks,
Andreas

Reply via email to