From da9cbd5fe9aaf74f1c1f78627ffed0e60878b0b6 Mon Sep 17 00:00:00 2001 From: Tom McLaughlin Date: Thu, 30 Oct 2025 15:45:56 -0700 Subject: [PATCH 1/2] Add a flag "enableIPE" to enable the IPE hadrian flavor --- compiler/ghc/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/ghc/default.nix b/compiler/ghc/default.nix index 4eb98d1eed..02a2dd8660 100644 --- a/compiler/ghc/default.nix +++ b/compiler/ghc/default.nix @@ -46,6 +46,8 @@ let self = , enableDWARF ? false +, enableIPE ? false + , enableTerminfo ? !stdenv.targetPlatform.isAndroid && # Terminfo does not work on older ghc cross arm and windows compilers (!haskell-nix.haskellLib.isCrossTarget || !(stdenv.targetPlatform.isAarch32 || stdenv.targetPlatform.isAarch64 || stdenv.targetPlatform.isWindows) || builtins.compareVersions ghc-version "8.10" >= 0) @@ -385,6 +387,7 @@ let + lib.optionalString enableDWARF "+debug_info" + lib.optionalString ((enableNativeBignum && hadrianHasNativeBignumFlavour) || targetPlatform.isGhcjs || targetPlatform.isWasm) "+native_bignum" + lib.optionalString (targetPlatform.isGhcjs || targetPlatform.isWasm) "+no_profiled_libs" + + lib.optionalString enableIPE "+ipe" } --docs=no-sphinx -j --verbose" # This is needed to prevent $GCC from emitting out of line atomics. # Those would then result in __aarch64_ldadd1_sync and others being referenced, which From 19c9ea7434c479b476ac99b1a3f5503983954787 Mon Sep 17 00:00:00 2001 From: Tom McLaughlin Date: Thu, 30 Oct 2025 20:51:36 -0700 Subject: [PATCH 2/2] Add extraFlavourTransformers option to GHC config (closes #2425) --- compiler/ghc/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/ghc/default.nix b/compiler/ghc/default.nix index 02a2dd8660..7bd2b0335b 100644 --- a/compiler/ghc/default.nix +++ b/compiler/ghc/default.nix @@ -63,6 +63,10 @@ let self = else "perf-cross-ncg" ) +, # Extra flavour transformers to pass to Hadrian. For example, +debug_ghc or + # +assertions to work on debugging the compiler. + extraFlavourTransformers ? [] + , # Whether to disable the large address space allocator # necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ disableLargeAddressSpace ? stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64 || stdenv.targetPlatform.isAndroid @@ -388,6 +392,7 @@ let + lib.optionalString ((enableNativeBignum && hadrianHasNativeBignumFlavour) || targetPlatform.isGhcjs || targetPlatform.isWasm) "+native_bignum" + lib.optionalString (targetPlatform.isGhcjs || targetPlatform.isWasm) "+no_profiled_libs" + lib.optionalString enableIPE "+ipe" + + lib.concatStrings extraFlavourTransformers } --docs=no-sphinx -j --verbose" # This is needed to prevent $GCC from emitting out of line atomics. # Those would then result in __aarch64_ldadd1_sync and others being referenced, which