summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
Diffstat (limited to 'hadrian')
-rw-r--r--hadrian/cfg/system.config.in4
-rw-r--r--hadrian/src/Oracles/Flag.hs6
-rw-r--r--hadrian/src/Oracles/Setting.hs4
-rw-r--r--hadrian/src/Rules/Generate.hs10
-rw-r--r--hadrian/src/Settings/Builders/Common.hs6
-rw-r--r--hadrian/src/Settings/Packages.hs6
-rw-r--r--hadrian/src/Settings/Warnings.hs4
7 files changed, 12 insertions, 28 deletions
diff --git a/hadrian/cfg/system.config.in b/hadrian/cfg/system.config.in
index 5d6d28d5f4..80fc3a3043 100644
--- a/hadrian/cfg/system.config.in
+++ b/hadrian/cfg/system.config.in
@@ -34,9 +34,7 @@ python = python3
#============================
ar-supports-at-file = @ArSupportsAtFile@
-cc-clang-backend = @CC_CLANG_BACKEND@
-cc-llvm-backend = @CC_LLVM_BACKEND@
-gcc-is-clang = @GccIsClang@
+cc-llvm-backend = @CcLlvmBackend@
hs-cpp-args = @HaskellCPPArgs@
# Build options:
diff --git a/hadrian/src/Oracles/Flag.hs b/hadrian/src/Oracles/Flag.hs
index 075a1bfe23..93babda794 100644
--- a/hadrian/src/Oracles/Flag.hs
+++ b/hadrian/src/Oracles/Flag.hs
@@ -11,7 +11,7 @@ import Oracles.Setting
data Flag = ArSupportsAtFile
| CrossCompiling
- | GccIsClang
+ | CcLlvmBackend
| GhcUnregisterised
| TablesNextToCode
| GmpInTree
@@ -23,13 +23,13 @@ data Flag = ArSupportsAtFile
| UseSystemFfi
-- Note, if a flag is set to empty string we treat it as set to NO. This seems
--- fragile, but some flags do behave like this, e.g. GccIsClang.
+-- fragile, but some flags do behave like this.
flag :: Flag -> Action Bool
flag f = do
let key = case f of
ArSupportsAtFile -> "ar-supports-at-file"
CrossCompiling -> "cross-compiling"
- GccIsClang -> "gcc-is-clang"
+ CcLlvmBackend -> "cc-llvm-backend"
GhcUnregisterised -> "ghc-unregisterised"
TablesNextToCode -> "tables-next-to-code"
GmpInTree -> "intree-gmp"
diff --git a/hadrian/src/Oracles/Setting.hs b/hadrian/src/Oracles/Setting.hs
index 2a4f5d0572..c84400ac69 100644
--- a/hadrian/src/Oracles/Setting.hs
+++ b/hadrian/src/Oracles/Setting.hs
@@ -25,8 +25,6 @@ data Setting = BuildArch
| BuildOs
| BuildPlatform
| BuildVendor
- | CcClangBackend
- | CcLlvmBackend
| CursesLibDir
| DynamicExtension
| FfiIncludeDir
@@ -113,8 +111,6 @@ setting key = lookupValueOrError configFile $ case key of
BuildOs -> "build-os"
BuildPlatform -> "build-platform"
BuildVendor -> "build-vendor"
- CcClangBackend -> "cc-clang-backend"
- CcLlvmBackend -> "cc-llvm-backend"
CursesLibDir -> "curses-lib-dir"
DynamicExtension -> "dynamic-extension"
FfiIncludeDir -> "ffi-include-dir"
diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs
index 3faafbaaf7..e185a46ea5 100644
--- a/hadrian/src/Rules/Generate.hs
+++ b/hadrian/src/Rules/Generate.hs
@@ -379,20 +379,10 @@ generateGhcAutoconfH :: Expr String
generateGhcAutoconfH = do
trackGenerateHs
configHContents <- expr $ map undefinePackage <$> readFileLines configH
- tablesNextToCode <- getFlag TablesNextToCode
- ghcUnreg <- getFlag GhcUnregisterised
- ccLlvmBackend <- getSetting CcLlvmBackend
- ccClangBackend <- getSetting CcClangBackend
return . unlines $
[ "#if !defined(__GHCAUTOCONF_H__)"
, "#define __GHCAUTOCONF_H__" ]
++ configHContents ++
- [ "\n#define TABLES_NEXT_TO_CODE 1" | tablesNextToCode && not ghcUnreg ]
- ++
- [ "\n#define llvm_CC_FLAVOR 1" | ccLlvmBackend == "1" ]
- ++
- [ "\n#define clang_CC_FLAVOR 1" | ccClangBackend == "1" ]
- ++
[ "#endif /* __GHCAUTOCONF_H__ */" ]
where
undefinePackage s
diff --git a/hadrian/src/Settings/Builders/Common.hs b/hadrian/src/Settings/Builders/Common.hs
index 7d9e0fe716..2c41d92493 100644
--- a/hadrian/src/Settings/Builders/Common.hs
+++ b/hadrian/src/Settings/Builders/Common.hs
@@ -53,9 +53,9 @@ cArgs = mempty
cWarnings :: Args
cWarnings = mconcat
[ arg "-Wall"
- , flag GccIsClang ? arg "-Wno-unknown-pragmas"
- , notM (flag GccIsClang) ? not windowsHost ? arg "-Werror=unused-but-set-variable"
- , notM (flag GccIsClang) ? arg "-Wno-error=inline" ]
+ , flag CcLlvmBackend ? arg "-Wno-unknown-pragmas"
+ , notM (flag CcLlvmBackend) ? not windowsHost ? arg "-Werror=unused-but-set-variable"
+ , notM (flag CcLlvmBackend) ? arg "-Wno-error=inline" ]
packageDatabaseArgs :: Args
packageDatabaseArgs = do
diff --git a/hadrian/src/Settings/Packages.hs b/hadrian/src/Settings/Packages.hs
index 94a586444d..ac3c28404e 100644
--- a/hadrian/src/Settings/Packages.hs
+++ b/hadrian/src/Settings/Packages.hs
@@ -106,7 +106,7 @@ packageArgs = do
, package ghcPrim ? mconcat
[ builder (Cabal Flags) ? arg "include-ghc-prim"
- , builder (Cc CompileC) ? (not <$> flag GccIsClang) ?
+ , builder (Cc CompileC) ? (not <$> flag CcLlvmBackend) ?
input "**/cbits/atomic.c" ? arg "-Wno-sync-nand" ]
--------------------------------- ghci ---------------------------------
@@ -278,10 +278,10 @@ rtsPackageArgs = package rts ? do
-- any warnings in the module. See:
-- https://gitlab.haskell.org/ghc/ghc/wikis/working-conventions#Warnings
- , (not <$> flag GccIsClang) ?
+ , (not <$> flag CcLlvmBackend) ?
inputs ["**/Compact.c"] ? arg "-finline-limit=2500"
- , input "**/RetainerProfile.c" ? flag GccIsClang ?
+ , input "**/RetainerProfile.c" ? flag CcLlvmBackend ?
arg "-Wno-incompatible-pointer-types"
, windowsHost ? arg ("-DWINVER=" ++ windowsVersion)
diff --git a/hadrian/src/Settings/Warnings.hs b/hadrian/src/Settings/Warnings.hs
index ea89fea3ef..0d654411c4 100644
--- a/hadrian/src/Settings/Warnings.hs
+++ b/hadrian/src/Settings/Warnings.hs
@@ -11,10 +11,10 @@ import Settings
defaultGhcWarningsArgs :: Args
defaultGhcWarningsArgs = mconcat
[ notStage0 ? arg "-Wnoncanonical-monad-instances"
- , (not <$> flag GccIsClang) ? mconcat
+ , (not <$> flag CcLlvmBackend) ? mconcat
[ not windowsHost ? arg "-optc-Werror=unused-but-set-variable"
, arg "-optc-Wno-error=inline" ]
- , flag GccIsClang ? arg "-optc-Wno-unknown-pragmas" ]
+ , flag CcLlvmBackend ? arg "-optc-Wno-unknown-pragmas" ]
-- | Package-specific warnings-related arguments, mostly suppressing various warnings.
ghcWarningsArgs :: Args