rustc, cargo-llvm-cov: enable profiler runtime on Darwin (#466280)

This commit is contained in:
John Ericson
2025-11-29 21:45:20 +00:00
committed by GitHub
2 changed files with 10 additions and 2 deletions
+1 -2
View File
@@ -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;
};
})
@@ -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}"
]