]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't use RTLD_DEEPBIND with ASAN
authorMatthew Newton <matthew-git@newtoncomputing.co.uk>
Fri, 18 Jun 2021 19:46:06 +0000 (20:46 +0100)
committerMatthew Newton <matthew-git@newtoncomputing.co.uk>
Fri, 18 Jun 2021 19:46:06 +0000 (20:46 +0100)
backport of 03a8f1d161

src/include/build.h
src/main/modules.c

index 93aebcab04e07774ed3215f3b18a1b8ac565fcf1..c25431b414ae49947dd6bb256edd982e60702c11 100644 (file)
@@ -61,6 +61,18 @@ extern "C" {
 #  define CC_BOUNDED(...)
 #endif
 
+/*
+ *      GCC uses __SANITIZE_ADDRESS__, clang uses __has_feature, which
+ *      GCC complains about.
+ */
+#ifndef __SANITIZE_ADDRESS__
+#ifdef __has_feature
+#if __has_feature(address_sanitizer)
+#define __SANITIZE_ADDRESS__ (1)
+#endif
+#endif
+#endif
+
 /*
  *     Macros to add pragmas
  */
index d0080623362345afb165ea5712d2129211634ab9..afe8d2e0eb8cde307c8c3e75b29a127358a475c4 100644 (file)
@@ -160,7 +160,7 @@ fr_dlhandle fr_dlopenext(char const *name)
        } else
 #endif
                flags |= RTLD_LOCAL;
-#ifdef RTLD_DEEPBIND
+#if defined(RTLD_DEEPBIND) && !defined(__SANITIZE_ADDRESS__)
                flags |= RTLD_DEEPBIND;
 #endif