From: Matthew Newton Date: Fri, 18 Jun 2021 19:46:06 +0000 (+0100) Subject: don't use RTLD_DEEPBIND with ASAN X-Git-Tag: release_3_0_24~194 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=346e1a0565701421eaaf54c66ae74aa3b9053ef7;p=thirdparty%2Ffreeradius-server.git don't use RTLD_DEEPBIND with ASAN backport of 03a8f1d161 --- diff --git a/src/include/build.h b/src/include/build.h index 93aebcab04e..c25431b414a 100644 --- a/src/include/build.h +++ b/src/include/build.h @@ -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 */ diff --git a/src/main/modules.c b/src/main/modules.c index d0080623362..afe8d2e0eb8 100644 --- a/src/main/modules.c +++ b/src/main/modules.c @@ -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