public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] libsanitizer
@ 2015-11-10 22:01 Andreas Tobler
  2016-01-11 18:28 ` Bernd Schmidt
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Tobler @ 2015-11-10 22:01 UTC (permalink / raw)
  To: GCC Patches

Hi all,

the attached patch removes the hard-coded requirement for the link 
operation with -ldl. On FreeBSD we do not need that, it breaks compilation.

The patch is tested against CentOS7.1

Ok to apply for trunk?

TIA,
Andreas

2015-11-10  Andreas Tobler  <andreast@gcc.gnu.org>

	* configure.ac: Replace the hard-coded -ldl requirement for
	link_sanitizer_common with a configure time check for -ldl.
	* configure: Regenerate.


Index: configure.ac
===================================================================
--- configure.ac	(revision 230119)
+++ configure.ac	(working copy)
@@ -96,7 +96,7 @@
  AC_CHECK_FUNCS(clock_getres clock_gettime clock_settime)

  # 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"
+])
+
  case "$host" in
    *-*-darwin*) MAC_INTERPOSE=true ; enable_static=no ;;
    *) MAC_INTERPOSE=false ;;

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-01-14 20:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-10 22:01 [patch] libsanitizer Andreas Tobler
2016-01-11 18:28 ` Bernd Schmidt
2016-01-11 18:37   ` Andreas Tobler
2016-01-11 18:57     ` Jakub Jelinek
2016-01-11 19:25       ` Andreas Tobler
2016-01-13 17:40     ` Bernd Schmidt
2016-01-14 20:51       ` Andreas Tobler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).