Unverified Commit 0fb2bc98 authored by Tristan Ross's avatar Tristan Ross
Browse files

libunwind: fix building with llvm

parent 7822f2f0
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
{ stdenv, lib, fetchFromGitHub, autoreconfHook, xz, buildPackages }:
{ stdenv, lib, fetchpatch, fetchFromGitHub, autoreconfHook, xz, buildPackages }:

stdenv.mkDerivation rec {
  pname = "libunwind";
@@ -11,6 +11,11 @@ stdenv.mkDerivation rec {
    hash = "sha256-rCFBHs6rCSnp5FEwbUR5veNNTqSQpFblAv8ebSPX0qE=";
  };

  patches = lib.optional (stdenv.targetPlatform.useLLVM or false) (fetchpatch {
    url = "https://github.com/libunwind/libunwind/pull/770/commits/a69d0f14c9e6c46e82ba6e02fcdedb2eb63b7f7f.patch";
    hash = "sha256-9oBZimCXonNN++jJs3emp9w+q1aj3eNzvSKPgh92itA=";
  });

  postPatch = if (stdenv.cc.isClang || stdenv.hostPlatform.isStatic) then ''
    substituteInPlace configure.ac --replace "-lgcc_s" ""
  '' else lib.optionalString stdenv.hostPlatform.isMusl ''