Commit 5ebb69ae authored by Zhen Zhang's avatar Zhen Zhang Committed by Andrey Mokhov

Drop GccLtXX flags, require GCC > 4.7 and up (#450)

See https://github.com/snowleopard/hadrian/issues/449.
parent 438dc576
......@@ -33,9 +33,6 @@ ar-supports-at-file = @ArSupportsAtFile@
cc-clang-backend = @CC_CLANG_BACKEND@
cc-llvm-backend = @CC_LLVM_BACKEND@
gcc-is-clang = @GccIsClang@
gcc-lt-34 = @GccLT34@
gcc-lt-44 = @GccLT44@
gcc-lt-46 = @GccLT46@
hs-cpp-args = @HaskellCPPArgs@
# Build options:
......
......@@ -11,9 +11,6 @@ import Oracles.Setting
data Flag = ArSupportsAtFile
| CrossCompiling
| GccIsClang
| GccLt34
| GccLt44
| GccLt46
| GhcUnregisterised
| LeadingUnderscore
| SolarisBrokenShld
......@@ -30,9 +27,6 @@ flag f = do
ArSupportsAtFile -> "ar-supports-at-file"
CrossCompiling -> "cross-compiling"
GccIsClang -> "gcc-is-clang"
GccLt34 -> "gcc-lt-34"
GccLt44 -> "gcc-lt-44"
GccLt46 -> "gcc-lt-46"
GhcUnregisterised -> "ghc-unregisterised"
LeadingUnderscore -> "leading-underscore"
SolarisBrokenShld -> "solaris-broken-shld"
......
......@@ -40,12 +40,11 @@ cArgs = mempty
-- TODO: should be in a different file
cWarnings :: Args
cWarnings = do
let gccGe46 = notM (flag GccIsClang ||^ flag GccLt46)
cWarnings =
mconcat [ arg "-Wall"
, flag GccIsClang ? arg "-Wno-unknown-pragmas"
, gccGe46 ? notM windowsHost ? arg "-Werror=unused-but-set-variable"
, gccGe46 ? arg "-Wno-error=inline" ]
, notM (flag GccIsClang) ? notM windowsHost ? arg "-Werror=unused-but-set-variable"
, notM (flag GccIsClang) ? arg "-Wno-error=inline" ]
bootPackageDatabaseArgs :: Args
bootPackageDatabaseArgs = do
......
......@@ -8,6 +8,5 @@ ghcPrimPackageArgs = package ghcPrim ? mconcat
[ builder GhcCabal ? arg "--flag=include-ghc-prim"
, builder (Cc CompileC) ?
(not <$> flag GccLt44) ?
(not <$> flag GccIsClang) ?
input "//cbits/atomic.c" ? arg "-Wno-sync-nand" ]
......@@ -204,7 +204,7 @@ rtsPackageArgs = package rts ? do
rtsWarnings :: Args
rtsWarnings = mconcat
[ pure ["-Wall", "-Werror"]
, flag GccLt34 ? arg "-W", not <$> flag GccLt34 ? arg "-Wextra"
, arg "-Wextra"
, arg "-Wstrict-prototypes"
, arg "-Wmissing-prototypes"
, arg "-Wmissing-declarations"
......@@ -214,5 +214,5 @@ rtsWarnings = mconcat
, arg "-Wmissing-noreturn"
, arg "-Wnested-externs"
, arg "-Wredundant-decls"
, not <$> flag GccLt46 ? arg "-Wundef"
, arg "-Wundef"
, arg "-fno-strict-aliasing" ]
......@@ -12,9 +12,8 @@ defaultGhcWarningsArgs :: Args
defaultGhcWarningsArgs = mconcat
[ notStage0 ? pure [ "-Werror", "-Wnoncanonical-monad-instances" ]
, (not <$> flag GccIsClang) ? mconcat
[ (not <$> flag GccLt46) ?
(not <$> windowsHost ) ? arg "-optc-Werror=unused-but-set-variable"
, (not <$> flag GccLt44) ? arg "-optc-Wno-error=inline" ]
[ (not <$> windowsHost ) ? arg "-optc-Werror=unused-but-set-variable"
, arg "-optc-Wno-error=inline" ]
, flag GccIsClang ? arg "-optc-Wno-unknown-pragmas" ]
-- | Package-specific warnings-related arguments, mostly suppressing various warnings.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment