From 5101e1a9f44703524efa3ae4353b2b10ce8a35f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?= Date: Wed, 12 Sep 2012 14:54:40 -0400 Subject: [PATCH] Bug 788276 - Properly check for broken (deprecated) compilers. r=gps. Check for old gcc versions. --- aclocal.m4 | 1 + build/autoconf/gcc-pr39608.m4 | 37 ++++++++++++++++++++++++++++ configure.in | 1 + js/src/aclocal.m4 | 1 + js/src/build/autoconf/gcc-pr39608.m4 | 37 ++++++++++++++++++++++++++++ js/src/configure.in | 1 + 6 files changed, 78 insertions(+) create mode 100644 build/autoconf/gcc-pr39608.m4 create mode 100644 js/src/build/autoconf/gcc-pr39608.m4 diff --git a/aclocal.m4 b/aclocal.m4 index 7944c3179cc..43a5816ed0f 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -17,6 +17,7 @@ builtin(include, build/autoconf/mozcommonheader.m4)dnl builtin(include, build/autoconf/acwinpaths.m4)dnl builtin(include, build/autoconf/lto.m4)dnl builtin(include, build/autoconf/gcc-pr49911.m4)dnl +builtin(include, build/autoconf/gcc-pr39608.m4)dnl builtin(include, build/autoconf/llvm-pr8927.m4)dnl builtin(include, build/autoconf/frameptr.m4)dnl builtin(include, build/autoconf/compiler-opts.m4)dnl diff --git a/build/autoconf/gcc-pr39608.m4 b/build/autoconf/gcc-pr39608.m4 new file mode 100644 index 00000000000..02de9faece2 --- /dev/null +++ b/build/autoconf/gcc-pr39608.m4 @@ -0,0 +1,37 @@ +dnl This Source Code Form is subject to the terms of the Mozilla Public +dnl License, v. 2.0. If a copy of the MPL was not distributed with this +dnl file, You can obtain one at http://mozilla.org/MPL/2.0/. + +dnl Check if the compiler is gcc and has pr39608. If so +dnl disable vrp. + +AC_DEFUN([MOZ_GCC_PR39608], +[ +AC_MSG_CHECKING(for gcc pr39608) +ac_have_gcc_pr39608="yes" +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +AC_TRY_COMPILE([ +typedef void (*FuncType)(); +template +void f(); +template class C { + typedef C ThisC; + template + static void h() { + f >(); + } +}; +], true, + ac_have_gcc_pr39608="no", + true) + +AC_LANG_RESTORE + +AC_MSG_RESULT($ac_have_gcc_pr39608) +if test "$ac_have_gcc_pr39608" = "yes"; then + echo This compiler would fail to build firefox, plase upgrade. + exit 1 +fi +]) diff --git a/configure.in b/configure.in index 1dbe17c5dac..c0313eed2af 100644 --- a/configure.in +++ b/configure.in @@ -2944,6 +2944,7 @@ AC_SUBST(WRAP_SYSTEM_INCLUDES) AC_SUBST(VISIBILITY_FLAGS) MOZ_GCC_PR49911 +MOZ_GCC_PR39608 MOZ_LLVM_PR8927 dnl Check for __force_align_arg_pointer__ for SSE2 on gcc diff --git a/js/src/aclocal.m4 b/js/src/aclocal.m4 index 610115debff..7d6b28dcf09 100644 --- a/js/src/aclocal.m4 +++ b/js/src/aclocal.m4 @@ -16,6 +16,7 @@ builtin(include, build/autoconf/mozcommonheader.m4)dnl builtin(include, build/autoconf/acwinpaths.m4)dnl builtin(include, build/autoconf/lto.m4)dnl builtin(include, build/autoconf/gcc-pr49911.m4)dnl +builtin(include, build/autoconf/gcc-pr39608.m4)dnl builtin(include, build/autoconf/llvm-pr8927.m4)dnl builtin(include, build/autoconf/frameptr.m4)dnl builtin(include, build/autoconf/compiler-opts.m4)dnl diff --git a/js/src/build/autoconf/gcc-pr39608.m4 b/js/src/build/autoconf/gcc-pr39608.m4 new file mode 100644 index 00000000000..02de9faece2 --- /dev/null +++ b/js/src/build/autoconf/gcc-pr39608.m4 @@ -0,0 +1,37 @@ +dnl This Source Code Form is subject to the terms of the Mozilla Public +dnl License, v. 2.0. If a copy of the MPL was not distributed with this +dnl file, You can obtain one at http://mozilla.org/MPL/2.0/. + +dnl Check if the compiler is gcc and has pr39608. If so +dnl disable vrp. + +AC_DEFUN([MOZ_GCC_PR39608], +[ +AC_MSG_CHECKING(for gcc pr39608) +ac_have_gcc_pr39608="yes" +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +AC_TRY_COMPILE([ +typedef void (*FuncType)(); +template +void f(); +template class C { + typedef C ThisC; + template + static void h() { + f >(); + } +}; +], true, + ac_have_gcc_pr39608="no", + true) + +AC_LANG_RESTORE + +AC_MSG_RESULT($ac_have_gcc_pr39608) +if test "$ac_have_gcc_pr39608" = "yes"; then + echo This compiler would fail to build firefox, plase upgrade. + exit 1 +fi +]) diff --git a/js/src/configure.in b/js/src/configure.in index 904593c4a39..1024491fa38 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -2527,6 +2527,7 @@ AC_SUBST(WRAP_SYSTEM_INCLUDES) AC_SUBST(VISIBILITY_FLAGS) MOZ_GCC_PR49911 +MOZ_GCC_PR39608 MOZ_LLVM_PR8927 dnl Checks for header files.