]> granicus.if.org Git - gc/commitdiff
Fix visibility of __asan_default_options in case of shared library
authorIvan Maidanski <ivmai@mail.ru>
Wed, 16 Aug 2017 22:39:16 +0000 (01:39 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 16 Aug 2017 23:15:30 +0000 (02:15 +0300)
(fix commit ce75cf1)

* os_dep.c [ADDRESS_SANITIZER && (UNIX_LIKE || NEED_FIND_LIMIT
|| MPROTECT_VDB)] (__asan_default_options): Do not define if
CUSTOM_ASAN_DEF_OPTIONS is defined; export it (use GC_API).

os_dep.c

index 03ba6bf8e4181ad021f5b7acaa1e9f972d58784a..cce2e6b07390ab3999310c9e014fca09cb2e3bf3 100644 (file)
--- a/os_dep.c
+++ b/os_dep.c
@@ -507,9 +507,11 @@ GC_INNER char * GC_get_maps(void)
 #endif /* NETBSD */
 
 #if defined(ADDRESS_SANITIZER) && (defined(UNIX_LIKE) \
-                    || defined(NEED_FIND_LIMIT) || defined(MPROTECT_VDB))
+                    || defined(NEED_FIND_LIMIT) || defined(MPROTECT_VDB)) \
+    && !defined(CUSTOM_ASAN_DEF_OPTIONS)
   /* To tell ASan to allow GC to use its own SIGBUS/SEGV handlers.      */
-  const char *__asan_default_options(void)
+  /* The function is exported just to be visible to ASan library.       */
+  GC_API const char *__asan_default_options(void)
   {
     return "allow_user_segv_handler=1";
   }