blob: dc6feff7ffa0725164d7746a0787b3b5d39a7157 [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001From 1b1a024efd18d44294e184e792c1e039cab02bfe Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 14 Feb 2016 09:14:12 +0000
4Subject: [PATCH] fix build for musl targets
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8Upstream-Status: Pending
9
10 configure.ac | 2 --
11 coregrind/vg_preloaded.c | 2 +-
12 include/pub_tool_redir.h | 7 +++++--
13 3 files changed, 6 insertions(+), 5 deletions(-)
14
15diff --git a/configure.ac b/configure.ac
16index 9366dc7..679f514 100644
17--- a/configure.ac
18+++ b/configure.ac
19@@ -1066,8 +1066,6 @@ case "${GLIBC_VERSION}" in
20 ;;
21 2.0|2.1|*)
22 AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
23- AC_MSG_ERROR([Valgrind requires glibc version 2.2 or later,])
24- AC_MSG_ERROR([Darwin libc, Bionic libc or Solaris libc])
25 ;;
26 esac
27
28diff --git a/coregrind/vg_preloaded.c b/coregrind/vg_preloaded.c
29index 2ea7a7a..e49c832 100644
30--- a/coregrind/vg_preloaded.c
31+++ b/coregrind/vg_preloaded.c
32@@ -56,7 +56,7 @@
33 void VG_NOTIFY_ON_LOAD(freeres)( void );
34 void VG_NOTIFY_ON_LOAD(freeres)( void )
35 {
36-# if !defined(__UCLIBC__) \
37+# if !defined(__UCLIBC__) && defined(__GLIBC__) \
38 && !defined(VGPV_arm_linux_android) \
39 && !defined(VGPV_x86_linux_android) \
40 && !defined(VGPV_mips32_linux_android) \
41diff --git a/include/pub_tool_redir.h b/include/pub_tool_redir.h
42index bac00d7..fbb2ef2 100644
43--- a/include/pub_tool_redir.h
44+++ b/include/pub_tool_redir.h
45@@ -242,8 +242,7 @@
46 /* --- Soname of the standard C library. --- */
47
48 #if defined(VGO_linux) || defined(VGO_solaris)
49-# define VG_Z_LIBC_SONAME libcZdsoZa // libc.so*
50-
51+# define VG_Z_LIBC_SONAME libcZdZa // libc.*
52 #elif defined(VGO_darwin) && (DARWIN_VERS <= DARWIN_10_6)
53 # define VG_Z_LIBC_SONAME libSystemZdZaZddylib // libSystem.*.dylib
54
55@@ -274,7 +273,11 @@
56 /* --- Soname of the pthreads library. --- */
57
58 #if defined(VGO_linux)
59+# if defined(__GLIBC__) || defined(__UCLIBC__)
60 # define VG_Z_LIBPTHREAD_SONAME libpthreadZdsoZd0 // libpthread.so.0
61+# else
62+# define VG_Z_LIBPTHREAD_SONAME libcZdZa // libc.*
63+#endif
64 #elif defined(VGO_darwin)
65 # define VG_Z_LIBPTHREAD_SONAME libSystemZdZaZddylib // libSystem.*.dylib
66 #elif defined(VGO_solaris)
67--
682.7.1
69