Merge pull request #29254 from knedlsepp/fix-valgrind

valgrind: Fix darwin build
This commit is contained in:
Daiderd Jordan 2017-09-17 20:09:56 +02:00 committed by GitHub
commit 036036a456
2 changed files with 9 additions and 38 deletions

View file

@ -18,7 +18,15 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
patches = stdenv.lib.optionals (stdenv.isDarwin) [ ./valgrind-bzero.patch ];
preConfigure = stdenv.lib.optionalString stdenv.isDarwin (
let OSRELEASE = ''
$(awk -F '"' '/#define OSRELEASE/{ print $2 }' \
<${xnu}/Library/Frameworks/Kernel.framework/Headers/libkern/version.h)'';
in ''
echo "Don't derive our xnu version using uname -r."
substituteInPlace configure --replace "uname -r" "echo ${OSRELEASE}"
''
);
postPatch = stdenv.lib.optionalString (stdenv.isDarwin)
# Apple's GCC doesn't recognize `-arch' (as of version 4.2.1, build 5666).

View file

@ -1,37 +0,0 @@
Index: coregrind/m_main.c
===================================================================
--- a/coregrind/m_main.c (revision 16102)
+++ b/coregrind/m_main.c (revision 16103)
@@ -3489,6 +3489,10 @@
// skip check
return VG_(memset)(s,c,n);
}
+void __bzero(void* s, UWord n);
+void __bzero(void* s, UWord n) {
+ (void)VG_(memset)(s,0,n);
+}
void bzero(void *s, SizeT n);
void bzero(void *s, SizeT n) {
VG_(memset)(s,0,n);
@@ -4058,20 +4062,7 @@
#endif
-#if defined(VGO_darwin) && DARWIN_VERS == DARWIN_10_10
-/* This might also be needed for > DARWIN_10_10, but I have no way
- to test for that. Hence '==' rather than '>=' in the version
- test above. */
-void __bzero ( void* s, UWord n );
-void __bzero ( void* s, UWord n )
-{
- (void) VG_(memset)( s, 0, n );
-}
-
-#endif
-
-
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/