diff options
author | Peter Trommler <ptrommler@acm.org> | 2017-11-06 15:35:30 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-11-06 16:39:20 -0500 |
commit | 59de290928e6903337f31c1f8107ac8a98ea145d (patch) | |
tree | 7c8cd1ebd75bd1bb0f11b0ac24965f82cc4d74f8 | |
parent | 8613e61de62178e76cd0f8915bd1fbe9c200a039 (diff) | |
download | haskell-59de290928e6903337f31c1f8107ac8a98ea145d.tar.gz |
Update autoconf test for gcc to require 4.7 and up
Fixing #14244 required the newer gcc atomic built-ins that are provided
from 4.7 and up. This updates the test to check for minimum gcc version
4.7.
The version tests for 3.4 (!), 4.4, and 4.6 are no longer needed and can
be removed. This makes the build system simpler.
Test Plan: validate
Reviewers: austin, bgamari, hvr, simonmar
Reviewed By: bgamari
Subscribers: rwbarton, thomie, erikd
Differential Revision: https://phabricator.haskell.org/D4165
-rw-r--r-- | aclocal.m4 | 16 | ||||
-rw-r--r-- | mk/config.mk.in | 3 | ||||
-rw-r--r-- | mk/warnings.mk | 6 | ||||
-rw-r--r-- | rts/ghc.mk | 6 |
4 files changed, 3 insertions, 28 deletions
diff --git a/aclocal.m4 b/aclocal.m4 index c8c59859b2..c5fdd1e53a 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1229,27 +1229,15 @@ if test -z "$CC" then AC_MSG_ERROR([gcc is required]) fi -GccLT34=NO -GccLT44=NO -GccLT46=NO AC_CACHE_CHECK([version of gcc], [fp_cv_gcc_version], [ # Be sure only to look at the first occurrence of the "version " string; # Some Apple compilers emit multiple messages containing this string. fp_cv_gcc_version="`$CC -v 2>&1 | sed -n -e '1,/version /s/.*version [[^0-9]]*\([[0-9.]]*\).*/\1/p'`" - FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-lt], [3.0], - [AC_MSG_ERROR([Need at least gcc version 3.0 (3.4+ recommended)])]) - # See #2770: gcc 2.95 doesn't work any more, apparently. There probably - # isn't a very good reason for that, but for now just make configure - # fail. - FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-lt], [3.4], GccLT34=YES) - FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-lt], [4.4], GccLT44=YES) - FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-lt], [4.6], GccLT46=YES) + FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-lt], [4.7], + [AC_MSG_ERROR([Need at least gcc version 4.7])]) ]) AC_SUBST([GccVersion], [$fp_cv_gcc_version]) -AC_SUBST(GccLT34) -AC_SUBST(GccLT44) -AC_SUBST(GccLT46) ])# FP_GCC_VERSION dnl Check to see if the C compiler is clang or llvm-gcc diff --git a/mk/config.mk.in b/mk/config.mk.in index 92661a32d1..b046abe112 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -522,9 +522,6 @@ GccVersion = @GccVersion@ # TargetPlatformFull retains the string passed to configure so we have it in # the necessary format to pass to libffi's configure. TargetPlatformFull = @TargetPlatformFull@ -GccLT34 = @GccLT34@ -GccLT44 = @GccLT44@ -GccLT46 = @GccLT46@ GccIsClang = @GccIsClang@ CC = @CC@ diff --git a/mk/warnings.mk b/mk/warnings.mk index 85cb1a0283..69990a75c5 100644 --- a/mk/warnings.mk +++ b/mk/warnings.mk @@ -20,21 +20,17 @@ GhcStage2HcOpts += -Wcpp-undef ifneq "$(GccIsClang)" "YES" # Debian doesn't turn -Werror=unused-but-set-variable on by default, so -# we turn it on explicitly for consistency with other users -ifeq "$(GccLT46)" "NO" +# we turn it on explicitly for consistency with other users. # Never set the flag on Windows as the host gcc may be too old. ifneq "$(HostOS_CPP)" "mingw32" SRC_CC_WARNING_OPTS += -Werror=unused-but-set-variable endif -endif -ifeq "$(GccLT44)" "NO" # Suppress the warning about __sync_fetch_and_nand (#9678). libraries/ghc-prim/cbits/atomic_CC_OPTS += -Wno-sync-nand # gcc 4.6 gives 3 warnings for giveCapabilityToTask not being inlined # gcc 4.4 gives 2 warnings for lockClosure not being inlined SRC_CC_WARNING_OPTS += -Wno-error=inline -endif else diff --git a/rts/ghc.mk b/rts/ghc.mk index 57db2970da..3ba7e53592 100644 --- a/rts/ghc.mk +++ b/rts/ghc.mk @@ -301,11 +301,7 @@ $(eval $(call distdir-opts,rts,dist,1)) # We like plenty of warnings. WARNING_OPTS += -Wall -ifeq "$(GccLT34)" "YES" -WARNING_OPTS += -W -else WARNING_OPTS += -Wextra -endif WARNING_OPTS += -Wstrict-prototypes WARNING_OPTS += -Wmissing-prototypes WARNING_OPTS += -Wmissing-declarations @@ -315,9 +311,7 @@ WARNING_OPTS += -Wpointer-arith WARNING_OPTS += -Wmissing-noreturn WARNING_OPTS += -Wnested-externs WARNING_OPTS += -Wredundant-decls -ifeq "$(GccLT46)" "NO" WARNING_OPTS += -Wundef -endif # These ones are hard to avoid: #WARNING_OPTS += -Wconversion |