From 0c37fa39c104f9c7c5f0b2297e3d52e8b8d58cac Mon Sep 17 00:00:00 2001 From: Paul Floyd Date: Sun, 20 Aug 2023 15:24:25 +0200 Subject: [PATCH] musl: enable libstdc++ freeres Both libc and libstdc++ freeres were disabled for musl. That means that libstdc++ was showing still reachable memory on systems like Alpine. --- coregrind/vg_preloaded.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/coregrind/vg_preloaded.c b/coregrind/vg_preloaded.c index 86f6ac5a2..a792081b1 100644 --- a/coregrind/vg_preloaded.c +++ b/coregrind/vg_preloaded.c @@ -76,7 +76,7 @@ DEFINE_GDB_PY_SCRIPT(VG_GDBSCRIPTS_DIR "/valgrind-monitor.py") void VG_NOTIFY_ON_LOAD(freeres)(Vg_FreeresToRun to_run); void VG_NOTIFY_ON_LOAD(freeres)(Vg_FreeresToRun to_run) { -# if !defined(__UCLIBC__) && !defined(MUSL_LIBC) \ +# if !defined(__UCLIBC__) \ && !defined(VGPV_arm_linux_android) \ && !defined(VGPV_x86_linux_android) \ && !defined(VGPV_mips32_linux_android) \ @@ -89,6 +89,14 @@ void VG_NOTIFY_ON_LOAD(freeres)(Vg_FreeresToRun to_run) _ZN9__gnu_cxx9__freeresEv(); } +# endif + +# if !defined(__UCLIBC__) && !defined(MUSL_LIBC) \ + && !defined(VGPV_arm_linux_android) \ + && !defined(VGPV_x86_linux_android) \ + && !defined(VGPV_mips32_linux_android) \ + && !defined(VGPV_arm64_linux_android) + extern void __libc_freeres(void) __attribute__((weak)); if (((to_run & VG_RUN__LIBC_FREERES) != 0) && (__libc_freeres != NULL)) { -- 2.11.4.GIT