]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
drd: Unbreak the musl build
authorBart Van Assche <bvanassche@acm.org>
Wed, 21 Oct 2020 02:40:19 +0000 (19:40 -0700)
committerBart Van Assche <bvanassche@acm.org>
Thu, 22 Oct 2020 00:33:30 +0000 (17:33 -0700)
See also https://bugs.kde.org/show_bug.cgi?id=428035.

Reported-by: Stacy <stacy.gaikovaia@windriver.com>
Fixes: 15330adf7c24 ("drd: Port to Fedora 33")
NEWS
drd/drd_pthread_intercepts.c

diff --git a/NEWS b/NEWS
index 8025a3f9fdfde7cabd02330a2264108cd56bec96..6afb26406283982f6b27e839be2cc7ae8ef6f0e4 100644 (file)
--- 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)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
index 62c466f508ad3a4365ccd431cab9289eff452267..585aafe22e416970923f80bd035f112d8b7fadcb 100644 (file)
@@ -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