summaryrefslogtreecommitdiff
path: root/hadrian/src/Rules/Gmp.hs
diff options
context:
space:
mode:
Diffstat (limited to 'hadrian/src/Rules/Gmp.hs')
-rw-r--r--hadrian/src/Rules/Gmp.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/hadrian/src/Rules/Gmp.hs b/hadrian/src/Rules/Gmp.hs
index 6d89a5b0e9..985f13ef29 100644
--- a/hadrian/src/Rules/Gmp.hs
+++ b/hadrian/src/Rules/Gmp.hs
@@ -8,6 +8,8 @@ import Packages
import Target
import Utilities
import Hadrian.BuildPath
+import Hadrian.Expression
+import Settings.Builders.Common (cArgs)
-- | Build in-tree GMP library objects (if GmpInTree flag is set) and return
-- their paths.
@@ -117,8 +119,10 @@ gmpRules = do
let gmpBuildP = takeDirectory mk
gmpP = takeDirectory gmpBuildP
ctx <- makeGmpPathContext gmpP
+ cFlags <- interpretInContext ctx $ mconcat [ cArgs, getStagedSettingList ConfCcArgs ]
env <- sequence
[ builderEnvironment "CC" $ Cc CompileC (stage ctx)
+ , return . AddEnv "CFLAGS" $ unwords cFlags
, builderEnvironment "AR" (Ar Unpack (stage ctx))
, builderEnvironment "NM" Nm
]