From 79f5f9bf1b805412634f2688e6c2068723d0ea35 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Wed, 3 Jul 2024 20:03:37 -0400 Subject: [PATCH] ghc: update Darwin bintools references MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Unconditionally get `install_name_tool` from cc.bintools.bintools since it is no longer wrapped; and - Use the `strip` wrapper on both Darwin architectures. It’s the default one, and it’s the same between both. --- pkgs/development/compilers/ghc/8.10.7.nix | 18 ++++++++---------- .../compilers/ghc/common-hadrian.nix | 18 ++++++++---------- .../ghc/common-make-native-bignum.nix | 18 ++++++++---------- 3 files changed, 24 insertions(+), 30 deletions(-) diff --git a/pkgs/development/compilers/ghc/8.10.7.nix b/pkgs/development/compilers/ghc/8.10.7.nix index c8669a2761f8..c8a56c219740 100644 --- a/pkgs/development/compilers/ghc/8.10.7.nix +++ b/pkgs/development/compilers/ghc/8.10.7.nix @@ -152,18 +152,16 @@ let otool = cc.bintools.bintools; - # GHC needs install_name_tool on all darwin platforms. On aarch64-darwin it is - # part of the bintools wrapper (due to codesigning requirements), but not on - # x86_64-darwin. We decide based on target platform to have consistent tools - # across all GHC stages. - install_name_tool = - if stdenv.targetPlatform.isAarch64 - then cc.bintools - else cc.bintools.bintools; - # Same goes for strip. + # GHC needs install_name_tool on all darwin platforms. The same one can + # be used on both platforms. It is safe to use with linker-generated + # signatures because it will update the signatures automatically after + # modifying the target binary. + install_name_tool = cc.bintools.bintools; + + # strip on darwin is wrapped to enable deterministic mode. strip = # TODO(@sternenseemann): also use wrapper if linker == "bfd" or "gold" - if stdenv.targetPlatform.isAarch64 && stdenv.targetPlatform.isDarwin + if stdenv.targetPlatform.isDarwin then cc.bintools else cc.bintools.bintools; }.${name}; diff --git a/pkgs/development/compilers/ghc/common-hadrian.nix b/pkgs/development/compilers/ghc/common-hadrian.nix index b5fef30332f7..c06c46fe9674 100644 --- a/pkgs/development/compilers/ghc/common-hadrian.nix +++ b/pkgs/development/compilers/ghc/common-hadrian.nix @@ -288,18 +288,16 @@ let otool = cc.bintools.bintools; - # GHC needs install_name_tool on all darwin platforms. On aarch64-darwin it is - # part of the bintools wrapper (due to codesigning requirements), but not on - # x86_64-darwin. We decide based on target platform to have consistent tools - # across all GHC stages. - install_name_tool = - if stdenv.targetPlatform.isAarch64 - then cc.bintools - else cc.bintools.bintools; - # Same goes for strip. + # GHC needs install_name_tool on all darwin platforms. The same one can + # be used on both platforms. It is safe to use with linker-generated + # signatures because it will update the signatures automatically after + # modifying the target binary. + install_name_tool = cc.bintools.bintools; + + # strip on darwin is wrapped to enable deterministic mode. strip = # TODO(@sternenseemann): also use wrapper if linker == "bfd" or "gold" - if stdenv.targetPlatform.isAarch64 && stdenv.targetPlatform.isDarwin + if stdenv.targetPlatform.isDarwin then cc.bintools else cc.bintools.bintools; }.${name}; diff --git a/pkgs/development/compilers/ghc/common-make-native-bignum.nix b/pkgs/development/compilers/ghc/common-make-native-bignum.nix index 79fced444f56..2b23cd75a0ed 100644 --- a/pkgs/development/compilers/ghc/common-make-native-bignum.nix +++ b/pkgs/development/compilers/ghc/common-make-native-bignum.nix @@ -157,18 +157,16 @@ let otool = cc.bintools.bintools; - # GHC needs install_name_tool on all darwin platforms. On aarch64-darwin it is - # part of the bintools wrapper (due to codesigning requirements), but not on - # x86_64-darwin. We decide based on target platform to have consistent tools - # across all GHC stages. - install_name_tool = - if stdenv.targetPlatform.isAarch64 - then cc.bintools - else cc.bintools.bintools; - # Same goes for strip. + # GHC needs install_name_tool on all darwin platforms. The same one can + # be used on both platforms. It is safe to use with linker-generated + # signatures because it will update the signatures automatically after + # modifying the target binary. + install_name_tool = cc.bintools.bintools; + + # strip on darwin is wrapped to enable deterministic mode. strip = # TODO(@sternenseemann): also use wrapper if linker == "bfd" or "gold" - if stdenv.targetPlatform.isAarch64 && stdenv.targetPlatform.isDarwin + if stdenv.targetPlatform.isDarwin then cc.bintools else cc.bintools.bintools; }.${name};