|
From: Paul F. <pa...@so...> - 2020-11-09 15:32:38
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=35c9c33897ef89b08e1518ed16244e70bc6996da commit 35c9c33897ef89b08e1518ed16244e70bc6996da Author: Paul Floyd <pj...@wa...> Date: Mon Nov 9 16:31:40 2020 +0100 Bug 384729 - __libc_freeres inhibits cross-platform valgrind Diff: --- coregrind/vg_preloaded.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/coregrind/vg_preloaded.c b/coregrind/vg_preloaded.c index 3ea3761f97..39d82c7c23 100644 --- a/coregrind/vg_preloaded.c +++ b/coregrind/vg_preloaded.c @@ -68,13 +68,12 @@ void VG_NOTIFY_ON_LOAD(freeres)(Vg_FreeresToRun to_run) _ZN9__gnu_cxx9__freeresEv(); } -# if defined(VGO_linux) - /* __libc_freeres() not yet available on Solaris. */ - extern void __libc_freeres(void); - if ((to_run & VG_RUN__LIBC_FREERES) != 0) { + extern void __libc_freeres(void) __attribute__((weak)); + if (((to_run & VG_RUN__LIBC_FREERES) != 0) && + (__libc_freeres != NULL)) { __libc_freeres(); } -# endif + # endif VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__FREERES_DONE, 0, 0, 0, 0, 0); |