From ad97a4885528522216877350e33f3586b838ad8e Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Sun, 24 Apr 2022 11:34:51 +0200 Subject: [PATCH] rr: disable LTO and build with current stdenv --- pkgs/development/tools/analysis/rr/default.nix | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pkgs/development/tools/analysis/rr/default.nix b/pkgs/development/tools/analysis/rr/default.nix index bda6f7e4e3c5..a667de3d5cb7 100644 --- a/pkgs/development/tools/analysis/rr/default.nix +++ b/pkgs/development/tools/analysis/rr/default.nix @@ -1,6 +1,6 @@ -{ lib, gcc9Stdenv, fetchFromGitHub, cmake, libpfm, zlib, pkg-config, python3Packages, which, procps, gdb, capnproto }: +{ lib, stdenv, fetchFromGitHub, cmake, libpfm, zlib, pkg-config, python3Packages, which, procps, gdb, capnproto }: -gcc9Stdenv.mkDerivation rec { +stdenv.mkDerivation rec { version = "5.5.0"; pname = "rr"; @@ -17,9 +17,15 @@ gcc9Stdenv.mkDerivation rec { patchShebangs . ''; - # TODO: remove this preConfigure hook after 5.2.0 since it is fixed upstream - # see https://github.com/mozilla/rr/issues/2269 - preConfigure = ''substituteInPlace CMakeLists.txt --replace "std=c++11" "std=c++14"''; + # With LTO enabled, linking fails with the following message: + # + # src/AddressSpace.cc:1666: undefined reference to `rr_syscall_addr' + # ld.bfd: bin/rr: hidden symbol `rr_syscall_addr' isn't defined + # ld.bfd: final link failed: bad value + # collect2: error: ld returned 1 exit status + # + # See also https://github.com/NixOS/nixpkgs/pull/110846 + preConfigure = ''substituteInPlace CMakeLists.txt --replace "-flto" ""''; nativeBuildInputs = [ cmake pkg-config which ]; buildInputs = [