Skip to content

Commit 5ce912e

Browse files
angermanhamishmack
andauthored
fix potentially broken install_name_tool (#2284)
* 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]>
1 parent 93937e0 commit 5ce912e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compiler/ghc/default.nix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,11 @@ stdenv.mkDerivation (rec {
434434
export STRIP="${bintoolsFor.strip}/bin/${bintoolsFor.strip.targetPrefix}strip"
435435
'' + lib.optionalString (stdenv.targetPlatform.linker == "cctools") ''
436436
export OTOOL="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}otool"
437-
export INSTALL_NAME_TOOL="${bintoolsFor.install_name_tool}/bin/${bintoolsFor.install_name_tool.targetPrefix}install_name_tool"
437+
if [ -f ${targetCC}/bin/${targetCC.targetPrefix}install_name_tool ]; then
438+
export INSTALL_NAME_TOOL="${targetCC}/bin/${targetCC.targetPrefix}install_name_tool"
439+
else
440+
export INSTALL_NAME_TOOL="${bintoolsFor.install_name_tool}/bin/${bintoolsFor.install_name_tool.targetPrefix}install_name_tool"
441+
fi
438442
'') + lib.optionalString (targetPlatform == hostPlatform && useLdGold)
439443
# set LD explicitly if we want gold even if we aren't cross compiling
440444
''

0 commit comments

Comments
 (0)