Mods: Don't use RTLD_DEEPBIND with ASAN

This commit is contained in:
Luke Street
2026-07-12 20:14:12 -06:00
parent 641ac5877e
commit 8cc4ce94b8
+9 -1
View File
@@ -6,6 +6,14 @@
#include <Windows.h>
#endif
#if defined(__SANITIZE_ADDRESS__)
#define ADDRESS_SANITIZER 1
#elif defined(__has_feature)
#if __has_feature(address_sanitizer)
#define ADDRESS_SANITIZER 1
#endif
#endif
namespace {
#if defined(_WIN32)
void* pl_dlopen(const std::filesystem::path& p) {
@@ -31,7 +39,7 @@ std::string pl_dlerror() {
#include <dlfcn.h>
void* pl_dlopen(const std::filesystem::path& p) {
int flags = RTLD_LAZY | RTLD_LOCAL;
#if defined(RTLD_DEEPBIND)
#if defined(RTLD_DEEPBIND) && !defined(ADDRESS_SANITIZER)
flags |= RTLD_DEEPBIND;
#endif
return dlopen(p.c_str(), flags);