File tree 1 file changed +15
-5
lines changed
1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -397,16 +397,26 @@ stdenv.mkDerivation (rec {
397
397
done
398
398
''
399
399
# Use emscripten and the `config.sub` saved by `postPatch`
400
- + lib . optionalString ( targetPlatform . isGhcjs ) ''
400
+ + lib . optionalString ( targetPlatform . isGhcjs ) ( ''
401
401
export CC="${ targetCC } /bin/emcc"
402
402
export CXX="${ targetCC } /bin/em++"
403
403
export LD="${ targetCC } /bin/emcc"
404
- export AR="${ targetCC } /bin/emar"
405
- export NM="${ targetCC } /share/emscripten/emnm"
406
- export RANLIB="${ targetCC } /bin/emranlib"
404
+ '' + (
405
+ # Including AR and RANLIB here breaks tests.js-template-haskell for GHC 9.6
406
+ # `LLVM ERROR: malformed uleb128, extends past end`
407
+ if builtins . compareVersions ghc-version "9.8" >= 0
408
+ then ''
409
+ export AR="${ targetCC } /bin/emar"
410
+ export NM="${ targetCC } /share/emscripten/emnm"
411
+ export RANLIB="${ targetCC } /bin/emranlib"
412
+ ''
413
+ else ''
414
+ export NM="${ targetCC } /share/emscripten/emnm"
415
+ ''
416
+ ) + ''
407
417
export EM_CACHE=$(mktemp -d)
408
418
mv config.sub.ghcjs config.sub
409
- ''
419
+ '' )
410
420
# GHC is a bit confused on its cross terminology, as these would normally be
411
421
# the *host* tools.
412
422
+ lib . optionalString ( ! targetPlatform . isGhcjs ) ( ''
You can’t perform that action at this time.
0 commit comments