summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-06-03 18:51:17 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-06-13 23:34:41 -0400
commit7bc5d6c6578ab9d60a83b81c7cc14819afef32ba (patch)
tree63c2e2e2669a48965c5508a3787b62b14837889a /hadrian
parent5ce63d52fed05371edb34b4f330c33bc85a45127 (diff)
downloadhaskell-7bc5d6c6578ab9d60a83b81c7cc14819afef32ba.tar.gz
Maintain separate flags for C++ compiler invocations
Previously we would pass flags intended for the C compiler to the C++ compiler (see #16738). This would cause, for instance, `-std=gnu99` to be passed to the C++ compiler, causing spurious test failures. Fix this by maintaining a separate set of flags for C++ compilation invocations.
Diffstat (limited to 'hadrian')
-rw-r--r--hadrian/cfg/system.config.in1
-rw-r--r--hadrian/src/Oracles/Setting.hs2
-rw-r--r--hadrian/src/Rules/Generate.hs1
3 files changed, 4 insertions, 0 deletions
diff --git a/hadrian/cfg/system.config.in b/hadrian/cfg/system.config.in
index fbb1f54854..5bdb322551 100644
--- a/hadrian/cfg/system.config.in
+++ b/hadrian/cfg/system.config.in
@@ -126,6 +126,7 @@ settings-c-compiler-command = @SettingsCCompilerCommand@
settings-haskell-cpp-command = @SettingsHaskellCPPCommand@
settings-haskell-cpp-flags = @SettingsHaskellCPPFlags@
settings-c-compiler-flags = @SettingsCCompilerFlags@
+settings-cxx-compiler-flags = @SettingsCxxCompilerFlags@
settings-c-compiler-link-flags = @SettingsCCompilerLinkFlags@
settings-c-compiler-supports-no-pie = @SettingsCCompilerSupportsNoPie@
settings-ld-command = @SettingsLdCommand@
diff --git a/hadrian/src/Oracles/Setting.hs b/hadrian/src/Oracles/Setting.hs
index 4c87d53404..89f5d70c9f 100644
--- a/hadrian/src/Oracles/Setting.hs
+++ b/hadrian/src/Oracles/Setting.hs
@@ -88,6 +88,7 @@ data SettingsFileSetting
| SettingsFileSetting_HaskellCPPCommand
| SettingsFileSetting_HaskellCPPFlags
| SettingsFileSetting_CCompilerFlags
+ | SettingsFileSetting_CxxCompilerFlags
| SettingsFileSetting_CCompilerLinkFlags
| SettingsFileSetting_CCompilerSupportsNoPie
| SettingsFileSetting_LdCommand
@@ -162,6 +163,7 @@ settingsFileSetting key = lookupValueOrError configFile $ case key of
SettingsFileSetting_HaskellCPPCommand -> "settings-haskell-cpp-command"
SettingsFileSetting_HaskellCPPFlags -> "settings-haskell-cpp-flags"
SettingsFileSetting_CCompilerFlags -> "settings-c-compiler-flags"
+ SettingsFileSetting_CxxCompilerFlags -> "settings-cxx-compiler-flags"
SettingsFileSetting_CCompilerLinkFlags -> "settings-c-compiler-link-flags"
SettingsFileSetting_CCompilerSupportsNoPie -> "settings-c-compiler-supports-no-pie"
SettingsFileSetting_LdCommand -> "settings-ld-command"
diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs
index 7f7fd2ee47..e1e64d1a1a 100644
--- a/hadrian/src/Rules/Generate.hs
+++ b/hadrian/src/Rules/Generate.hs
@@ -277,6 +277,7 @@ generateSettings = do
[ ("GCC extra via C opts", expr $ lookupValueOrError configFile "gcc-extra-via-c-opts")
, ("C compiler command", expr $ settingsFileSetting SettingsFileSetting_CCompilerCommand)
, ("C compiler flags", expr $ settingsFileSetting SettingsFileSetting_CCompilerFlags)
+ , ("C++ compiler flags", expr $ settingsFileSetting SettingsFileSetting_CxxCompilerFlags)
, ("C compiler link flags", expr $ settingsFileSetting SettingsFileSetting_CCompilerLinkFlags)
, ("C compiler supports -no-pie", expr $ settingsFileSetting SettingsFileSetting_CCompilerSupportsNoPie)
, ("Haskell CPP command", expr $ settingsFileSetting SettingsFileSetting_HaskellCPPCommand)