From 03e0cc45047bace01833ccd0b4474ea4b48a829d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Mon, 26 Jun 2023 07:26:56 +0100 Subject: [PATCH] fix valgrind --- riscv/valgrind/default.nix | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/riscv/valgrind/default.nix b/riscv/valgrind/default.nix index 5c372c5..74020e4 100644 --- a/riscv/valgrind/default.nix +++ b/riscv/valgrind/default.nix @@ -4,9 +4,6 @@ fetchFromGitHub, perl, gdb, - cctools, - xnu, - bootstrap_cmds, autoreconfHook, }: let source = builtins.fromJSON (builtins.readFile ./source.json); @@ -27,7 +24,7 @@ in # GDB is needed to provide a sane default for `--db-command'. # Perl is needed for `callgrind_{annotate,control}'. - buildInputs = [gdb perl] ++ lib.optionals (stdenv.isDarwin) [bootstrap_cmds xnu]; + buildInputs = [gdb perl]; # Perl is also a native build input. nativeBuildInputs = [autoreconfHook perl]; @@ -35,39 +32,9 @@ in enableParallelBuilding = true; separateDebugInfo = stdenv.isLinux; - preConfigure = 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}" - - # Apple's GCC doesn't recognize `-arch' (as of version 4.2.1, build 5666). - echo "getting rid of the \`-arch' GCC option..." - find -name Makefile\* -exec \ - sed -i {} -e's/DARWIN\(.*\)-arch [^ ]\+/DARWIN\1/g' \; - - sed -i coregrind/link_tool_exe_darwin.in \ - -e 's/^my \$archstr = .*/my $archstr = "x86_64";/g' - - substituteInPlace coregrind/m_debuginfo/readmacho.c \ - --replace /usr/bin/dsymutil ${stdenv.cc.bintools.bintools}/bin/dsymutil - - echo "substitute hardcoded /usr/bin/ld with ${cctools}/bin/ld" - substituteInPlace coregrind/link_tool_exe_darwin.in \ - --replace /usr/bin/ld ${cctools}/bin/ld - '' - ); - # To prevent rebuild on linux when moving darwin's postPatch fixes to preConfigure postPatch = ""; - configureFlags = - lib.optional (stdenv.hostPlatform.system == "x86_64-linux" || stdenv.hostPlatform.system == "x86_64-darwin") "--enable-only64bit" - ++ lib.optional stdenv.hostPlatform.isDarwin "--with-xcodedir=${xnu}/include"; - doCheck = true; postInstall = ''