package/valgrind: Fix musl build
PATCH 1/1 package/valgrind: Fix musl build
Fixes
http://autobuild.buildroot.net/results/bd8/bd85f48823e1acd590dcfc00ba7d2e53d837d154/
Signed-off-by Bernd Kuhls <[email protected]>
--- package/valgrind/0004-musl.patch | 51 ++++++++++++++++++++++++++++++++++++++++ package/valgrind/valgrind.mk | 2 ++ 2 files changed, 53 insertions(+) create mode 100644 package/valgrind/0004-musl.patch
package/valgrind/0004-musl.patch new file +51 -0
@@ -0,0 +1,51 @@ +Fix musl build + +Patch suggested by Thomas: http://patchwork.ozlabs.org/patch/538683/ + +Signed-off-by: Bernd Kuhls <[email protected]> + +diff -upr valgrind-3.11.0.orig/configure.ac valgrind-3.11.0/configure.ac +--- valgrind-3.11.0.orig/configure.ac 2015-10-03 02:28:18.597612716 +0200 ++++ valgrind-3.11.0/configure.ac 2015-10-03 02:28:49.284502749 +0200 +@@ -1066,8 +1066,6 @@ case "${GLIBC_VERSION}" in + ;; + 2.0|2.1|*) + AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}]) +- AC_MSG_ERROR([Valgrind requires glibc version 2.2 or later,]) +- AC_MSG_ERROR([Darwin libc, Bionic libc or Solaris libc]) + ;; + esac + +diff -upr valgrind-3.11.0.orig/coregrind/vg_preloaded.c valgrind-3.11.0/coregrind/vg_preloaded.c +--- valgrind-3.11.0.orig/coregrind/vg_preloaded.c 2015-10-03 02:28:18.367636023 +0200 ++++ valgrind-3.11.0/coregrind/vg_preloaded.c 2015-10-03 02:28:37.745672152 +0200 +@@ -56,7 +56,7 @@ + void VG_NOTIFY_ON_LOAD(freeres)( void ); + void VG_NOTIFY_ON_LOAD(freeres)( void ) + { +-# if !defined(__UCLIBC__) \ ++# if defined(__GLIBC__) \ + && !defined(VGPV_arm_linux_android) \ + && !defined(VGPV_x86_linux_android) \ + && !defined(VGPV_mips32_linux_android) \ +diff -upr valgrind-3.11.0.orig/include/pub_tool_redir.h valgrind-3.11.0/include/pub_tool_redir.h +--- valgrind-3.11.0.orig/include/pub_tool_redir.h 2015-10-03 02:28:18.304309107 +0200 ++++ valgrind-3.11.0/include/pub_tool_redir.h 2015-10-03 02:28:37.745672152 +0200 +@@ -242,7 +242,7 @@ + /* --- Soname of the standard C library. --- */ + + #if defined(VGO_linux) || defined(VGO_solaris) +-# define VG_Z_LIBC_SONAME libcZdsoZa // libc.so* ++# define VG_Z_LIBC_SONAME libcZdZa // libc.* + + #elif defined(VGO_darwin) && (DARWIN_VERS <= DARWIN_10_6) + # define VG_Z_LIBC_SONAME libSystemZdZaZddylib // libSystem.*.dylib +@@ -274,7 +274,7 @@ + /* --- Soname of the pthreads library. --- */ + + #if defined(VGO_linux) +-# define VG_Z_LIBPTHREAD_SONAME libpthreadZdsoZd0 // libpthread.so.0 ++# define VG_Z_LIBPTHREAD_SONAME libcZdZa // libc.* + #elif defined(VGO_darwin) + # define VG_Z_LIBPTHREAD_SONAME libSystemZdZaZddylib // libSystem.*.dylib + #elif defined(VGO_solaris)
package/valgrind/valgrind.mk +2 -0
@@ -9,6 +9,8 @@ VALGRIND_SITE = http://valgrind.org/downloads VALGRIND_SOURCE = valgrind-$(VALGRIND_VERSION).tar.bz2 VALGRIND_LICENSE = GPLv2 GFDLv1.2 VALGRIND_LICENSE_FILES = COPYING COPYING.DOCS +# we patch configure.ac in 0004-musl.patch +VALGRIND_AUTORECONF = YES VALGRIND_CONF_OPTS = --disable-ubsan VALGRIND_INSTALL_STAGING = YES
Signature · 1 line
2.7.0.rc3
PATCH 1/1 package/valgrind: Fix musl build
Dear Bernd Kuhls,
package/valgrind/0004-musl.patch line 3
Quoted 9 lines · Bernd Kuhls
package/valgrind/0004-musl.patch new file +3
-0@@ -0,0 +1,51 @@ +Fix musl build + +Patch suggested by Thomas: http://patchwork.ozlabs.org/patch/538683/
Did I ? I don't think I suggested this patch, only pointed some existing ones.
Quoted 8 lines
package/valgrind/0004-musl.patch new file +8
-0+diff -upr valgrind-3.11.0.orig/include/pub_tool_redir.h valgrind-3.11.0/include/pub_tool_redir.h +--- valgrind-3.11.0.orig/include/pub_tool_redir.h 2015-10-03 02:28:18.304309107 +0200 ++++ valgrind-3.11.0/include/pub_tool_redir.h 2015-10-03 02:28:37.745672152 +0200 +@@ -242,7 +242,7 @@ + /* --- Soname of the standard C library. --- */ + + #if defined(VGO_linux) || defined(VGO_solaris) +-# define VG_Z_LIBC_SONAME libcZdsoZa // libc.so*
package/valgrind/0004-musl.patch line 48
Quoted 10 lines
package/valgrind/0004-musl.patch new file +10
-0++# define VG_Z_LIBC_SONAME libcZdZa // libc.* + + #elif defined(VGO_darwin) && (DARWIN_VERS <= DARWIN_10_6) + # define VG_Z_LIBC_SONAME libSystemZdZaZddylib // libSystem.*.dylib +@@ -274,7 +274,7 @@ + /* --- Soname of the pthreads library. --- */ + + #if defined(VGO_linux) +-# define VG_Z_LIBPTHREAD_SONAME libpthreadZdsoZd0 // libpthread.so.0 ++# define VG_Z_LIBPTHREAD_SONAME libcZdZa // libc.*
I don't quite understand this one. While indeed with musl everything is in libc.so, it's not the case for glibc and uClibc. Doesn't this break stuff for glibc and uClibc ?
Any chance to submit this upstream so that we get some kind of review from the valgrind maintainers ?
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com