diff --git a/pkgs/by-name/ca/cargo-llvm-cov/package.nix b/pkgs/by-name/ca/cargo-llvm-cov/package.nix index 52db65a97405..4de52a2360c3 100644 --- a/pkgs/by-name/ca/cargo-llvm-cov/package.nix +++ b/pkgs/by-name/ca/cargo-llvm-cov/package.nix @@ -93,7 +93,6 @@ rustPlatform.buildRustPackage (finalAttrs: { CobaltCause ]; - # The profiler runtime is (currently) disabled on non-Linux platforms - broken = !(stdenv.hostPlatform.isLinux && !stdenv.targetPlatform.isRedox); + broken = stdenv.targetPlatform.isRedox; }; }) diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix index d2364f7aa533..b483594f7979 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -240,6 +240,15 @@ stdenv.mkDerivation (finalAttrs: { ++ optionals (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) [ "--enable-profiler" # build libprofiler_builtins ] + ++ optionals stdenv.targetPlatform.isDarwin [ + # potentially other llvm targets work with the same fix? + "--enable-profiler" # build libprofiler_builtins + # Disable profiler for targets that don't support it + "--set=target.wasm32-unknown-unknown.profiler=false" + "--set=target.wasm32v1-none.profiler=false" + "--set=target.bpfel-unknown-none.profiler=false" + "--set=target.bpfeb-unknown-none.profiler=false" + ] ++ optionals stdenv.buildPlatform.isMusl [ "${setBuild}.musl-root=${pkgsBuildBuild.targetPackages.stdenv.cc.libc}" ]