libunwind: fix building with llvm

This commit is contained in:
Tristan Ross
2024-07-25 14:33:05 -07:00
parent 7822f2f015
commit 0fb2bc9895
@@ -1,4 +1,4 @@
{ 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 ''