Skip to content

Commit

Permalink
Use emscripten
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishmack committed Mar 16, 2023
1 parent ab870dc commit 054e5bb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler/ghc/default.nix
Expand Up @@ -212,7 +212,7 @@ let

toolsForTarget =
if targetPlatform.isGhcjs
then []
then [ buildPackages.emscripten ]
else if hostPlatform == buildPlatform
then [ targetPackages.stdenv.cc ] ++ lib.optional useLLVM llvmPackages.llvm
else assert targetPlatform == hostPlatform; # build != host == target
Expand Down Expand Up @@ -295,20 +295,20 @@ stdenv.mkDerivation (rec {
''
# GHC is a bit confused on its cross terminology, as these would normally be
# the *host* tools.
+ lib.optionalString (!targetPlatform.isGhcjs) (''
+ ''
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
export CXX="${targetCC}/bin/${targetCC.targetPrefix}c++"
''
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
+ ''
+ lib.optionalString (!targetPlatform.isGhcjs) ''
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${lib.optionalString useLdGold ".gold"}"
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
'') + lib.optionalString (targetPlatform == hostPlatform && useLdGold)
'' + lib.optionalString (targetPlatform == hostPlatform && useLdGold)
# set LD explicitly if we want gold even if we aren't cross compiling
''
export LD="${targetCC.bintools}/bin/ld.gold"
Expand Down

0 comments on commit 054e5bb

Please sign in to comment.