Skip to content

Commit

Permalink
rustc: patch the path to llvm-strip instead of using /usr/bin/strip o…
Browse files Browse the repository at this point in the history
…n darwin
  • Loading branch information
GaetanLepage committed Dec 6, 2024
1 parent 0597be3 commit 4f6016c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkgs/development/compilers/rust/rustc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,13 @@ in stdenv.mkDerivation (finalAttrs: {
# Useful debugging parameter
# export VERBOSE=1
'' + lib.optionalString stdenv.targetPlatform.isDarwin ''
# Replace hardcoded path to strip with llvm-strip
# https://github.com/NixOS/nixpkgs/issues/299606
substituteInPlace compiler/rustc_codegen_ssa/src/back/link.rs \
--replace-fail \
'let stripcmd = if cfg!(target_os = "macos") { "/usr/bin/strip" } else { "strip" };' \
'let stripcmd = "${lib.getExe' llvmPackages.llvm "llvm-strip"}";'
'' + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) ''
# See https://github.com/jemalloc/jemalloc/issues/1997
# Using a value of 48 should work on both emulated and native x86_64-darwin.
Expand Down

0 comments on commit 4f6016c

Please sign in to comment.