Unverified Commit 6cf7b66f authored by Peder Bergebakken Sundt's avatar Peder Bergebakken Sundt Committed by GitHub
Browse files

Merge pull request #330014 from ExpidusOS/fix/pkgsllvm/libunwind

libunwind: fix building with llvm
parents 022bea5d 0fb2bc98
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 ''