summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2017-09-17 20:09:56 +0200
committerGitHub <noreply@github.com>2017-09-17 20:09:56 +0200
commit036036a456a1585699f545de45ab6dc04dd5bdfe (patch)
tree62f7c9e98548d60b2997d6451f36c164cc6701f6 /pkgs
parent261bac277f403548ff7f877a0370358cf2af3510 (diff)
parentc71fd768225b8db59ab60ee4b0e64c2b771d5fd7 (diff)
downloadnixpkgs-036036a456a1585699f545de45ab6dc04dd5bdfe.tar
nixpkgs-036036a456a1585699f545de45ab6dc04dd5bdfe.tar.gz
nixpkgs-036036a456a1585699f545de45ab6dc04dd5bdfe.tar.bz2
nixpkgs-036036a456a1585699f545de45ab6dc04dd5bdfe.tar.lz
nixpkgs-036036a456a1585699f545de45ab6dc04dd5bdfe.tar.xz
nixpkgs-036036a456a1585699f545de45ab6dc04dd5bdfe.tar.zst
nixpkgs-036036a456a1585699f545de45ab6dc04dd5bdfe.zip
Merge pull request #29254 from knedlsepp/fix-valgrind
valgrind: Fix darwin build
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/tools/analysis/valgrind/default.nix10
-rw-r--r--pkgs/development/tools/analysis/valgrind/valgrind-bzero.patch37
2 files changed, 9 insertions, 38 deletions
diff --git a/pkgs/development/tools/analysis/valgrind/default.nix b/pkgs/development/tools/analysis/valgrind/default.nix
index 21dba34e884..875feea84d4 100644
--- a/pkgs/development/tools/analysis/valgrind/default.nix
+++ b/pkgs/development/tools/analysis/valgrind/default.nix
@@ -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).
diff --git a/pkgs/development/tools/analysis/valgrind/valgrind-bzero.patch b/pkgs/development/tools/analysis/valgrind/valgrind-bzero.patch
deleted file mode 100644
index f56a277ad71..00000000000
--- a/pkgs/development/tools/analysis/valgrind/valgrind-bzero.patch
+++ /dev/null
@@ -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                                                          ---*/
- /*--------------------------------------------------------------------*/
-