Skip to content

Commit

Permalink
fix potentially broken install_name_tool
Browse files Browse the repository at this point in the history
We by default try to pull the one from the targetCC, only if that fails fall back to the bintools one.
  • Loading branch information
angerman committed Nov 29, 2024
1 parent 8488e9d commit 7fee6ed
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/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 7fee6ed

Please sign in to comment.