From d61a22fb0e5f48f7559e1ff91dad228a37d6cb9e Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Tue, 27 Feb 2018 20:31:15 -0500 Subject: [PATCH] strace: Fix cross-compilation --- pkgs/development/libraries/libunwind/default.nix | 2 ++ pkgs/development/tools/misc/strace/default.nix | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/libunwind/default.nix b/pkgs/development/libraries/libunwind/default.nix index 6afdac3fdf5c..b901d352808e 100644 --- a/pkgs/development/libraries/libunwind/default.nix +++ b/pkgs/development/libraries/libunwind/default.nix @@ -33,4 +33,6 @@ stdenv.mkDerivation rec { platforms = platforms.linux; license = licenses.mit; }; + + passthru.supportsHost = !stdenv.hostPlatform.isRiscV; } diff --git a/pkgs/development/tools/misc/strace/default.nix b/pkgs/development/tools/misc/strace/default.nix index 80d1a75e801d..f5da3f9daa4d 100644 --- a/pkgs/development/tools/misc/strace/default.nix +++ b/pkgs/development/tools/misc/strace/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, perl, libunwind }: +{ stdenv, fetchurl, perl, libunwind, buildPackages }: stdenv.mkDerivation rec { name = "strace-${version}"; @@ -9,11 +9,12 @@ stdenv.mkDerivation rec { sha256 = "0dsw6xcfrmygidp1dj2ch8cl8icrar7789snkb2r8gh78kdqhxjw"; }; + depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ perl ]; - buildInputs = [ libunwind ]; # support -k + buildInputs = stdenv.lib.optional libunwind.supportsHost [ libunwind ]; # support -k - configureFlags = stdenv.lib.optional stdenv.hostPlatform.isAarch64 "--enable-mpers=check"; + configureFlags = stdenv.lib.optional (stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isRiscV) "--enable-mpers=check"; meta = with stdenv.lib; { homepage = http://strace.io/;