From: Bart Van Assche Date: Wed, 21 Oct 2020 02:40:19 +0000 (-0700) Subject: drd: Unbreak the musl build X-Git-Tag: VALGRIND_3_17_0~135 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3073d03e4b6e76797828b3f466863dbdda76cc7a;p=thirdparty%2Fvalgrind.git drd: Unbreak the musl build See also https://bugs.kde.org/show_bug.cgi?id=428035. Reported-by: Stacy Fixes: 15330adf7c24 ("drd: Port to Fedora 33") --- diff --git a/NEWS b/NEWS index 8025a3f9fd..6afb264062 100644 --- a/NEWS +++ b/NEWS @@ -53,6 +53,7 @@ n-i-bz helgrind: If hg_cli__realloc fails, return NULL. 425232 PPC ISA 3.1 support is missing, part 2 426123 PPC ISA 3.1 support is missing, part 3 427787 Support new faccessat2 linux syscall (439) +428035 drd: Unbreak the musl build Release 3.16.1 (?? June 2020) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/drd/drd_pthread_intercepts.c b/drd/drd_pthread_intercepts.c index 62c466f508..585aafe22e 100644 --- a/drd/drd_pthread_intercepts.c +++ b/drd/drd_pthread_intercepts.c @@ -174,6 +174,13 @@ static int never_true; ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl \ { return implf argl; } #else +#ifdef MUSL_LIBC +/* musl provides a single library that includes pthreads functions. */ +#define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl) \ + ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl; \ + ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl \ + { return implf argl; } +#else /* * On Linux, intercept both the libc and the libpthread functions. At * least glibc 2.32.9000 (Fedora 34) has an implementation of all pthread @@ -188,6 +195,7 @@ static int never_true; ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl \ { return implf argl; } #endif +#endif /** * Macro for generating three Valgrind interception functions: one with the