mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-24 13:49:01 -04:00
Mods: Don't use RTLD_DEEPBIND with ASAN
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user