summaryrefslogtreecommitdiff
path: root/git-annex.cabal
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2018-03-04 19:48:07 -0400
committerJoey Hess <joeyh@joeyh.name>2018-03-04 19:48:07 -0400
commit6063b3df3f545c7c51c835533039a6d7ff00aa69 (patch)
treebc46ef77f855311dc49574fdf068a4bae9d92724 /git-annex.cabal
parent0361937ee3251492e013d38bdab3d910fe893aec (diff)
Dial back optimisation when building on arm
Prevent ghc and llc from running out of memory when optimising some files. Sean Whitton reported that doing this only in Test.hs was insufficient, the build still OOMed by the time it got to Test.hs. He had earlier found the build worked when these options are applied globally. See https://ghc.haskell.org/trac/ghc/ticket/14821 for why it needs -O1; once that's fixed it may suffice to use "GHC-Options: -O2 -optlo-O2", although it may also be that the -O1 prevents ghc from using/leaking as much memory. os(arm) should match armel, armhf, armeb, and arm. It probably also matches arm64, somewhat unfortunately since arm64 systems probably tend to have more memory. See list of arches in https://hackage.haskell.org/package/Cabal-1.22.2.0/docs/src/Distribution-System.html This commit was sponsored by Henrik Riomar on Patreon.
Diffstat (limited to 'git-annex.cabal')
-rw-r--r--git-annex.cabal7
1 files changed, 6 insertions, 1 deletions
diff --git a/git-annex.cabal b/git-annex.cabal
index 2b17f67296..994e015704 100644
--- a/git-annex.cabal
+++ b/git-annex.cabal
@@ -377,7 +377,12 @@ Executable git-annex
-- Fully optimize for production.
if flag(Production)
- GHC-Options: -O2
+ -- Lower memory systems can run out of memory with -O2, so
+ -- optimise slightly less.
+ if arch(arm)
+ GHC-Options: -O1 -optlo-O2
+ else
+ GHC-Options: -O2
-- Avoid linking with unused dynamic libaries.
-- (Only tested on Linux).