diff --git a/src/main.cc b/src/main.cc index 973ed93d1ac..128fcbe37f4 100644 --- a/src/main.cc +++ b/src/main.cc @@ -234,6 +234,13 @@ size_t saved_argv0_space() { using namespace rr; int main(int argc, char* argv[]) { + +#ifdef __SANITIZE_ADDRESS__ + if (getenv("ASAN_OPTIONS") == NULL) { + setenv("ASAN_OPTIONS", "verify_asan_link_order=0", 1); + } +#endif + rr::saved_argv0_ = argv[0]; rr::saved_argv0_space_ = argv[argc - 1] + strlen(argv[argc - 1]) + 1 - rr::saved_argv0_;