Bug 1262781 - Use the host compiler for the ASTMatcher check. r=froydnj
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 08 Apr 2016 16:32:42 +0900
changeset 330797 17cb8c4b18b48c8958a2a2eff56ad23e8bd23d11
parent 330796 8a41989bd1b44c2bb2efc262f46e529bac146e6c
child 330798 c24444a009c19e25462c7c191eb3cf4d14f2d264
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1262781
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1262781 - Use the host compiler for the ASTMatcher check. r=froydnj The check is for the clang plugin, which is a host library. It is especially important to use the host compiler for this check on OSX-on-Linux cross builds.
build/autoconf/clang-plugin.m4
--- a/build/autoconf/clang-plugin.m4
+++ b/build/autoconf/clang-plugin.m4
@@ -96,21 +96,24 @@ if test -n "$ENABLE_CLANG_PLUGIN"; then
     dnl middle of the 3.8 cycle, our CLANG_VERSION_FULL is impossible to use
     dnl correctly, so we have to detect this at configure time.
     AC_CACHE_CHECK(for new ASTMatcher names,
                    ac_cv_have_new_ASTMatcher_names,
         [
             AC_LANG_SAVE
             AC_LANG_CPLUSPLUS
             _SAVE_CXXFLAGS="$CXXFLAGS"
+            _SAVE_CXX="$CXX"
             CXXFLAGS="${LLVM_CXXFLAGS}"
+            CXX="${HOST_CXX}"
             AC_TRY_COMPILE([#include "clang/ASTMatchers/ASTMatchers.h"],
                            [clang::ast_matchers::cxxConstructExpr();],
                            ac_cv_have_new_ASTMatcher_names="yes",
                            ac_cv_have_new_ASTMatcher_names="no")
+            CXX="$_SAVE_CXX"
             CXXFLAGS="$_SAVE_CXXFLAGS"
             AC_LANG_RESTORE
         ])
     if test "$ac_cv_have_new_ASTMatcher_names" = "yes"; then
       LLVM_CXXFLAGS="$LLVM_CXXFLAGS -DHAVE_NEW_ASTMATCHER_NAMES"
     fi
 
     AC_DEFINE(MOZ_CLANG_PLUGIN)