Skip to content

Commit

Permalink
fix potentially broken install_name_tool (#2284)
Browse files Browse the repository at this point in the history
* fix potentially broken install_name_tool

We by default try to pull the one from the targetCC, only if that fails fall back to the bintools one.

* Consistent use of `${targetCC.targetPrefix}`

---------

Co-authored-by: Hamish Mackenzie <[email protected]>
  • Loading branch information
angerman and hamishmack authored Dec 4, 2024
1 parent 93937e0 commit 5ce912e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion compiler/ghc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,11 @@ stdenv.mkDerivation (rec {
export STRIP="${bintoolsFor.strip}/bin/${bintoolsFor.strip.targetPrefix}strip"
'' + lib.optionalString (stdenv.targetPlatform.linker == "cctools") ''
export OTOOL="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}otool"
export INSTALL_NAME_TOOL="${bintoolsFor.install_name_tool}/bin/${bintoolsFor.install_name_tool.targetPrefix}install_name_tool"
if [ -f ${targetCC}/bin/${targetCC.targetPrefix}install_name_tool ]; then
export INSTALL_NAME_TOOL="${targetCC}/bin/${targetCC.targetPrefix}install_name_tool"
else
export INSTALL_NAME_TOOL="${bintoolsFor.install_name_tool}/bin/${bintoolsFor.install_name_tool.targetPrefix}install_name_tool"
fi
'') + lib.optionalString (targetPlatform == hostPlatform && useLdGold)
# set LD explicitly if we want gold even if we aren't cross compiling
''
Expand Down

0 comments on commit 5ce912e

Please sign in to comment.