diff --git a/compiler/ghc/default.nix b/compiler/ghc/default.nix index 9c54386adc..29b05841e9 100644 --- a/compiler/ghc/default.nix +++ b/compiler/ghc/default.nix @@ -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" @@ -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 ''