diff --git a/src/zInit.cpp b/src/zInit.cpp index 2d5236265..6e437c3c4 100644 --- a/src/zInit.cpp +++ b/src/zInit.cpp @@ -16,9 +16,10 @@ class LateInitializer { public: LateInitializer() { Dl_info dl_info; - if (dladdr((const void*)Hooks::init, &dl_info) && dl_info.dli_fname != NULL) { + if (!OS::isMusl() && dladdr((const void*)Hooks::init, &dl_info) && dl_info.dli_fname != NULL) { // Make sure async-profiler DSO cannot be unloaded, since it contains JVM callbacks. - // Don't use ELF NODELETE flag because of https://sourceware.org/bugzilla/show_bug.cgi?id=20839 + // This is not relevant for musl, where dlclose() is no-op. + // Can't use ELF NODELETE flag because of https://sourceware.org/bugzilla/show_bug.cgi?id=20839 dlopen(dl_info.dli_fname, RTLD_LAZY | RTLD_NODELETE); } diff --git a/test/native/testRunner.hpp b/test/native/testRunner.hpp index aeb9f8c3b..a97eac15f 100644 --- a/test/native/testRunner.hpp +++ b/test/native/testRunner.hpp @@ -75,8 +75,8 @@ struct TestCase { std::is_same::value || std::is_same::value; \ if (is_string) { \ if ((std::string(#op) == "==") || (std::string(#op) == "!=")) { \ - const char* str1 = reinterpret_cast(val1); \ - const char* str2 = reinterpret_cast(val2); \ + const char* str1 = (const char*)(intptr_t)(val1); \ + const char* str2 = (const char*)(intptr_t)(val2); \ if ((std::string(#op) == "==" && (str1 != str2) && !(str1 && str2 && strcmp(str1, str2) == 0)) || \ (std::string(#op) == "!=" && (str1 == str2 || (str1 && str2 && strcmp(str1, str2) == 0)))) { \ printf("Assertion failed: (%s %s %s),\n\tactual values: %s = \"%s\", %s = \"%s\"\n\tat %s:%d\n", \