Merge pull request from ExpidusOS/fix/pkgsllvm/libunwind

libunwind: fix building with llvm
This commit is contained in:
Peder Bergebakken Sundt 2024-08-07 02:03:48 +02:00 committed by GitHub
commit 6cf7b66f10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 ''