build/autoconf/gcc-pr39608.m4

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 dnl This Source Code Form is subject to the terms of the Mozilla Public
     2 dnl License, v. 2.0. If a copy of the MPL was not distributed with this
     3 dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
     5 dnl Check if the compiler is gcc and has pr39608. If so
     6 dnl disable vrp.
     8 AC_DEFUN([MOZ_GCC_PR39608],
     9 [
    10 AC_MSG_CHECKING(for gcc pr39608)
    11 ac_have_gcc_pr39608="yes"
    12 AC_LANG_SAVE
    13 AC_LANG_CPLUSPLUS
    15 AC_TRY_COMPILE([
    16 typedef void (*FuncType)();
    17 template<FuncType Impl>
    18 void f();
    19 template<typename T> class C {
    20   typedef C<T> ThisC;
    21   template<int g()>
    22   static void h() {
    23     f<ThisC::h<g> >();
    24   }
    25 };
    26 ], true,
    27    ac_have_gcc_pr39608="no",
    28    true)
    30 AC_LANG_RESTORE
    32 AC_MSG_RESULT($ac_have_gcc_pr39608)
    33 if test "$ac_have_gcc_pr39608" = "yes"; then
    34    echo This compiler would fail to build firefox, please upgrade.
    35    exit 1
    36 fi
    37 ])

mercurial