Skip to content

Commit

Permalink
Better fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishmack committed Nov 29, 2024
1 parent 821ad3b commit 689d5bc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions compiler/ghc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ let
# disableLargeAddress space conditional on iOS = true.
+ lib.optionalString (stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64)
" '*.*.ghc.c.opts += -optc-mcpu=apple-a7 -optc-march=armv8-a+norcpc'"
+ lib.optionalString (targetPlatform.isAndroid && targetPlatform.isAarch32)
" '*.*.ghc.c.opts += -optc-march=armv7-a -optc-mfloat-abi=softfp -optc-mfpu=vfpv3-d16'"
+ lib.optionalString (targetPlatform.isAndroid && targetPlatform.isAarch64)
" '*.*.ghc.c.opts += -optc-march=armv8-a'"
# For GHC versions in the 9.x range that don't support the +native_bignum flavour transformer yet
+ lib.optionalString ((enableNativeBignum && !hadrianHasNativeBignumFlavour))
" --bignum=native"
Expand Down Expand Up @@ -805,11 +809,6 @@ stdenv.mkDerivation (rec {
if [[ -f rts/win32/ThrIOManager.c ]]; then
substituteInPlace rts/win32/ThrIOManager.c --replace rts\\OSThreads.h rts/OSThreads.h
fi
''
+ lib.optionalString (targetPlatform.isAndroid && targetPlatform.isAarch32) ''
export NIX_CFLAGS_COMPILE_${
lib.replaceStrings ["-" "."] ["_" "_"] stdenv.targetPlatform.config
}+=" -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16"
'';
# Same hack as 'preBuild'
preInstall = lib.optionalString stdenv.buildPlatform.isDarwin ''
Expand Down

0 comments on commit 689d5bc

Please sign in to comment.