@@ -781,7 +781,7 @@ stdenv.mkDerivation (rec {
781
781
dontStrip = true ;
782
782
dontPatchELF = true ;
783
783
noAuditTmpdir = true ;
784
- } // lib . optionalAttrs ( stdenv . buildPlatform . isDarwin || stdenv . targetPlatform . isWindows ) {
784
+ } // {
785
785
# ghc install on macOS wants to run `xattr -r -c`
786
786
# The macOS version fails because it wants python 2.
787
787
# The nix version of xattr does not support those args.
@@ -805,6 +805,11 @@ stdenv.mkDerivation (rec {
805
805
if [[ -f rts/win32/ThrIOManager.c ]]; then
806
806
substituteInPlace rts/win32/ThrIOManager.c --replace rts\\OSThreads.h rts/OSThreads.h
807
807
fi
808
+ ''
809
+ + lib . optionalString ( targetPlatform . isAndroid && targetPlatform . isAarch32 ) ''
810
+ export NIX_CFLAGS_COMPILE_${
811
+ lib . replaceStrings [ "-" "." ] [ "_" "_" ] stdenv . targetPlatform . config
812
+ } +=" -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16"
808
813
'' ;
809
814
# Same hack as 'preBuild'
810
815
preInstall = lib . optionalString stdenv . buildPlatform . isDarwin ''
@@ -827,6 +832,7 @@ stdenv.mkDerivation (rec {
827
832
'cross-compiling = NO'
828
833
'' ;
829
834
buildPhase = ''
835
+ runHook preBuild
830
836
${ hadrian } /bin/hadrian ${ hadrianArgs }
831
837
'' + lib . optionalString ( installStage1 && ! stdenv . targetPlatform . isGhcjs && builtins . compareVersions ghc-version "9.8" < 0 ) ''
832
838
${ hadrian } /bin/hadrian ${ hadrianArgs } stage1:lib:libiserv
@@ -841,6 +847,8 @@ stdenv.mkDerivation (rec {
841
847
mv $exe ${ targetPrefix } $exe
842
848
done
843
849
popd
850
+ '' + ''
851
+ runHook postBuild
844
852
'' ;
845
853
846
854
# Hadrian's installation only works for native compilers, and is broken for cross compilers.
0 commit comments