ghc: update Darwin bintools references

- 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.
This commit is contained in:
Randy Eckenrode 2024-07-03 20:03:37 -04:00
parent ca92415e87
commit 79f5f9bf1b
No known key found for this signature in database
GPG Key ID: 64C1CD4EC2A600D9
3 changed files with 24 additions and 30 deletions

View File

@ -152,18 +152,16 @@ let
otool = cc.bintools.bintools; otool = cc.bintools.bintools;
# GHC needs install_name_tool on all darwin platforms. On aarch64-darwin it is # GHC needs install_name_tool on all darwin platforms. The same one can
# part of the bintools wrapper (due to codesigning requirements), but not on # be used on both platforms. It is safe to use with linker-generated
# x86_64-darwin. We decide based on target platform to have consistent tools # signatures because it will update the signatures automatically after
# across all GHC stages. # modifying the target binary.
install_name_tool = install_name_tool = cc.bintools.bintools;
if stdenv.targetPlatform.isAarch64
then cc.bintools # strip on darwin is wrapped to enable deterministic mode.
else cc.bintools.bintools;
# Same goes for strip.
strip = strip =
# TODO(@sternenseemann): also use wrapper if linker == "bfd" or "gold" # TODO(@sternenseemann): also use wrapper if linker == "bfd" or "gold"
if stdenv.targetPlatform.isAarch64 && stdenv.targetPlatform.isDarwin if stdenv.targetPlatform.isDarwin
then cc.bintools then cc.bintools
else cc.bintools.bintools; else cc.bintools.bintools;
}.${name}; }.${name};

View File

@ -288,18 +288,16 @@ let
otool = cc.bintools.bintools; otool = cc.bintools.bintools;
# GHC needs install_name_tool on all darwin platforms. On aarch64-darwin it is # GHC needs install_name_tool on all darwin platforms. The same one can
# part of the bintools wrapper (due to codesigning requirements), but not on # be used on both platforms. It is safe to use with linker-generated
# x86_64-darwin. We decide based on target platform to have consistent tools # signatures because it will update the signatures automatically after
# across all GHC stages. # modifying the target binary.
install_name_tool = install_name_tool = cc.bintools.bintools;
if stdenv.targetPlatform.isAarch64
then cc.bintools # strip on darwin is wrapped to enable deterministic mode.
else cc.bintools.bintools;
# Same goes for strip.
strip = strip =
# TODO(@sternenseemann): also use wrapper if linker == "bfd" or "gold" # TODO(@sternenseemann): also use wrapper if linker == "bfd" or "gold"
if stdenv.targetPlatform.isAarch64 && stdenv.targetPlatform.isDarwin if stdenv.targetPlatform.isDarwin
then cc.bintools then cc.bintools
else cc.bintools.bintools; else cc.bintools.bintools;
}.${name}; }.${name};

View File

@ -157,18 +157,16 @@ let
otool = cc.bintools.bintools; otool = cc.bintools.bintools;
# GHC needs install_name_tool on all darwin platforms. On aarch64-darwin it is # GHC needs install_name_tool on all darwin platforms. The same one can
# part of the bintools wrapper (due to codesigning requirements), but not on # be used on both platforms. It is safe to use with linker-generated
# x86_64-darwin. We decide based on target platform to have consistent tools # signatures because it will update the signatures automatically after
# across all GHC stages. # modifying the target binary.
install_name_tool = install_name_tool = cc.bintools.bintools;
if stdenv.targetPlatform.isAarch64
then cc.bintools # strip on darwin is wrapped to enable deterministic mode.
else cc.bintools.bintools;
# Same goes for strip.
strip = strip =
# TODO(@sternenseemann): also use wrapper if linker == "bfd" or "gold" # TODO(@sternenseemann): also use wrapper if linker == "bfd" or "gold"
if stdenv.targetPlatform.isAarch64 && stdenv.targetPlatform.isDarwin if stdenv.targetPlatform.isDarwin
then cc.bintools then cc.bintools
else cc.bintools.bintools; else cc.bintools.bintools;
}.${name}; }.${name};