Skip to content

Commit

Permalink
Changed condition to only use DEEPBIND in Linux and FreeBSD builds
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo Dias <ricardo.dias@percona.com>
  • Loading branch information
rjd15372 committed Feb 10, 2025
1 parent 0b59455 commit a221102
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -12275,14 +12275,13 @@ int moduleLoad(const char *path, void **module_argv, int module_argc, int is_loa
}

int dlopen_flags = RTLD_NOW | RTLD_LOCAL;
#if !defined(__SANITIZE_ADDRESS__) && !defined(__APPLE__)
#if (defined(__linux__) || defined(__FreeBSD__)) && !defined(__SANITIZE_ADDRESS__)
/* RTLD_DEEPBIND, which is required for loading modules that contains the
* same symbols, does not work with ASAN. Therefore, we exclude
* RTLD_DEEPBIND when doing test builds with ASAN.
* See https://github.com/google/sanitizers/issues/611 for more details.
* This flag is also not available in macos, but the default symbol
* resolution behavior in macos is the same as when we use DEEPBIND in
* Linux. */
*
* This flag is also currently only available in Linux and FreeBSD. */
dlopen_flags |= RTLD_DEEPBIND;
#endif

Expand Down

0 comments on commit a221102

Please sign in to comment.