Skip to content

Commit 99ee6c1

Browse files
authored
Add enableIPE and extraFlavourTransformers options to GHC derivation (#2447)
* Add a flag "enableIPE" to enable the IPE hadrian flavor * Add extraFlavourTransformers option to GHC config (closes #2425)
1 parent ce4ab11 commit 99ee6c1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

compiler/ghc/default.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ let self =
4646

4747
, enableDWARF ? false
4848

49+
, enableIPE ? false
50+
4951
, enableTerminfo ? !stdenv.targetPlatform.isAndroid &&
5052
# Terminfo does not work on older ghc cross arm and windows compilers
5153
(!haskell-nix.haskellLib.isCrossTarget || !(stdenv.targetPlatform.isAarch32 || stdenv.targetPlatform.isAarch64 || stdenv.targetPlatform.isWindows) || builtins.compareVersions ghc-version "8.10" >= 0)
@@ -61,6 +63,10 @@ let self =
6163
else "perf-cross-ncg"
6264
)
6365

66+
, # Extra flavour transformers to pass to Hadrian. For example, +debug_ghc or
67+
# +assertions to work on debugging the compiler.
68+
extraFlavourTransformers ? []
69+
6470
, # Whether to disable the large address space allocator
6571
# necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
6672
disableLargeAddressSpace ? stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64 || stdenv.targetPlatform.isAndroid
@@ -385,6 +391,8 @@ let
385391
+ lib.optionalString enableDWARF "+debug_info"
386392
+ lib.optionalString ((enableNativeBignum && hadrianHasNativeBignumFlavour) || targetPlatform.isGhcjs || targetPlatform.isWasm) "+native_bignum"
387393
+ lib.optionalString (targetPlatform.isGhcjs || targetPlatform.isWasm) "+no_profiled_libs"
394+
+ lib.optionalString enableIPE "+ipe"
395+
+ lib.concatStrings extraFlavourTransformers
388396
} --docs=no-sphinx -j --verbose"
389397
# This is needed to prevent $GCC from emitting out of line atomics.
390398
# Those would then result in __aarch64_ldadd1_sync and others being referenced, which

0 commit comments

Comments
 (0)