Unverified Commit 7f179a1b authored by Audrey Dutcher's avatar Audrey Dutcher Committed by Artemis Tosini
Browse files

rustc: do not force compilation with libunwind on FreeBSD

FreeBSD's unwind libs are named "libgcc" despite being llvm in origin
and come from the FreeBSD source tree.
parent 88f09c87
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@ in stdenv.mkDerivation (finalAttrs: {
  ] ++ optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [
    # https://github.com/rust-lang/rust/issues/92173
    "--set rust.jemalloc"
  ] ++ optionals useLLVM [
  ] ++ optionals (useLLVM && !stdenv.targetPlatform.isFreeBSD) [
    # https://github.com/NixOS/nixpkgs/issues/311930
    "--llvm-libunwind=${if withBundledLLVM then "in-tree" else "system"}"
    "--enable-use-libcxx"
@@ -262,7 +262,7 @@ in stdenv.mkDerivation (finalAttrs: {
  buildInputs = [ openssl ]
    ++ optionals stdenv.hostPlatform.isDarwin [ libiconv Security zlib ]
    ++ optional (!withBundledLLVM) llvmShared.lib
    ++ optional (useLLVM && !withBundledLLVM) [
    ++ optional (useLLVM && !withBundledLLVM && !stdenv.targetPlatform.isFreeBSD) [
      llvmPackages.libunwind
      # Hack which is used upstream https://github.com/gentoo/gentoo/blob/master/dev-lang/rust/rust-1.78.0.ebuild#L284
      (runCommandLocal "libunwind-libgcc" {} ''