Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions pkgs/development/compilers/rust/rustc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
llvmSharedForHost,
llvmSharedForTarget,
llvmPackages,
runCommandLocal,
fetchurl,
file,
python3,
Expand Down Expand Up @@ -353,14 +352,8 @@ stdenv.mkDerivation (finalAttrs: {
zlib
]
++ optional (!withBundledLLVM) llvmShared.lib
++ optional (useLLVM && !withBundledLLVM && !stdenv.targetPlatform.isFreeBSD) [
++ optionals (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" { } ''
mkdir -p $out/lib
ln -s ${llvmPackages.libunwind}/lib/libunwind.so $out/lib/libgcc_s.so
ln -s ${llvmPackages.libunwind}/lib/libunwind.so $out/lib/libgcc_s.so.1
'')
];

outputs = [
Expand Down Expand Up @@ -421,10 +414,13 @@ stdenv.mkDerivation (finalAttrs: {
# If rustc can't target a platform, we also can't build rustc for
# that platform.
badPlatforms = rustc.badTargetPlatforms;
# Builds, but can't actually compile anything
# `-gnu` ABI targets do not support partial GNU userlands like `pkgsLLVM`, only `-musl` ABI targets do
# https://github.com/rust-lang/rust/issues/119504#issuecomment-1873544519
#
# It *can* still build, but it won't actually compile anything
# https://github.com/NixOS/nixpkgs/issues/311930
# https://github.com/rust-lang/rust/issues/55120
# https://github.com/rust-lang/rust/issues/82521
broken = stdenv.hostPlatform.useLLVM;
broken = stdenv.targetPlatform.useLLVM && stdenv.targetPlatform.libc != "musl";
};
})