From 464187c4869b6a1f2cc81ebf2ff08d2e0911b678 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 6 Dec 2024 13:20:08 +0100 Subject: [PATCH] rustc: patch the path to llvm-strip instead of using /usr/bin/strip on darwin --- pkgs/development/compilers/rust/rustc.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix index 0e999407c9d0..508942a97c7a 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -227,6 +227,11 @@ in stdenv.mkDerivation (finalAttrs: { # Useful debugging parameter # export VERBOSE=1 + '' + lib.optionalString (stdenv.hostPlatform.isDarwin || 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 "/usr/bin/strip" "${lib.getExe' llvmShared "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.