Merge pull request #170072 from collares/rr-compile-fix

rr: disable LTO and build with current stdenv
This commit is contained in:
Rick van Schijndel 2022-04-24 20:09:26 +02:00 committed by GitHub
commit 93cf2b3865
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 = [