From c69a3ca3b493689194e0f879a9e945e905c6d7da Mon Sep 17 00:00:00 2001 From: Matheus Date: Thu, 30 Oct 2025 00:51:52 -0300 Subject: [PATCH] mlibc: add workaround for mlibc rtld global scope dlopen bug --- patches/mlibc/jinx-working-patch.patch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/patches/mlibc/jinx-working-patch.patch b/patches/mlibc/jinx-working-patch.patch index 89d4ed29..eb6f33c3 100644 --- a/patches/mlibc/jinx-working-patch.patch +++ b/patches/mlibc/jinx-working-patch.patch @@ -225,3 +225,17 @@ index 119574e..f9f1cde 100644 } void backtrace_symbols_fd(void *const *buffer, int size, int fd) { +diff --git mlibc-clean/options/rtld/generic/main.cpp mlibc-workdir/options/rtld/generic/main.cpp +index b2db152..e6438fe 100644 +--- mlibc-clean/options/rtld/generic/main.cpp ++++ mlibc-workdir/options/rtld/generic/main.cpp +@@ -681,6 +681,9 @@ void *__dlapi_open(const char *file, int flags, void *returnAddress) { + } + } + ++ if (isGlobal) ++ object->localScope = globalScope.get(); ++ + Loader linker{object->localScope, nullptr, false, rts}; + linker.linkObjects(object); + linker.initObjects(initialRepository.get());