diff --git a/pkgs/development/tools/misc/valgrind/default.nix b/pkgs/development/tools/misc/valgrind/default.nix index c98c2fe0756d..820868ca8e7b 100644 --- a/pkgs/development/tools/misc/valgrind/default.nix +++ b/pkgs/development/tools/misc/valgrind/default.nix @@ -12,4 +12,14 @@ stdenv.mkDerivation { md5 = "30dc51f6fc94751b90b04af9c2e2c656"; }; buildInputs = [perl]; + + # Hack to get Valgrind to compile with Linux 2.6.10 headers. The + # file `include/asm/processor.h' indirectly needs + # CONFIG_X86_L1_CACHE_SHIFT (for the alignment of some type that + # probably isn't relevant here anyway). + # !!! maybe this should be done in linux-headers? + NIX_CFLAGS_COMPILE = "-DCONFIG_X86_L1_CACHE_SHIFT=7"; + + # Another kernel header problem. + patches = [./pgoff_t.patch]; } diff --git a/pkgs/development/tools/misc/valgrind/pgoff_t.patch b/pkgs/development/tools/misc/valgrind/pgoff_t.patch new file mode 100644 index 000000000000..94dfd0e28dd9 --- /dev/null +++ b/pkgs/development/tools/misc/valgrind/pgoff_t.patch @@ -0,0 +1,34 @@ +diff -rc valgrind-orig/coregrind/vg_unsafe.h valgrind-2.2.0/coregrind/vg_unsafe.h +*** valgrind-orig/coregrind/vg_unsafe.h 2004-08-29 23:02:28.000000000 +0200 +--- valgrind-2.2.0/coregrind/vg_unsafe.h 2005-02-23 21:39:25.000000000 +0100 +*************** +*** 31,36 **** +--- 31,40 ---- + */ + + ++ #ifndef pgoff_t ++ #define pgoff_t unsigned long ++ #endif ++ + /* These includes are only used for making sense of the args for + system calls. */ + #include "vg_unistd.h" /* for system call numbers */ +*************** +*** 47,53 **** + #include /* for struct msghdr */ + #include /* for SIOCOUTQ */ + #include /* for sockaddr_un */ +! #include /* for struct ifreq et al */ + #include /* for struct arpreq */ + #include /* for struct rtentry */ + #ifdef HAVE_LINUX_COMPILER_H +--- 51,58 ---- + #include /* for struct msghdr */ + #include /* for SIOCOUTQ */ + #include /* for sockaddr_un */ +! /* hack - should be fixed in CVS */ +! //#include /* for struct ifreq et al */ + #include /* for struct arpreq */ + #include /* for struct rtentry */ + #ifdef HAVE_LINUX_COMPILER_H