Use a C++ compiler for the atomic builtin check since we'll
authorEric Christopher <echristo@apple.com>
Wed, 28 Jul 2010 20:26:34 +0000 (20:26 +0000)
committerEric Christopher <echristo@apple.com>
Wed, 28 Jul 2010 20:26:34 +0000 (20:26 +0000)
be using a C++ compiler to build.

Patch by Török Edwin!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109646 91177308-0d34-0410-b5e6-96231b3b80d8

autoconf/configure.ac

index 9541b8a46c39e9c4b3b7cff6ecf80e7a1e6ce18c..0924a777b4c1e4c856016a04e2f2b68c715e977e 100644 (file)
@@ -1355,6 +1355,9 @@ fi
 
 dnl atomic builtins are required for threading support.
 AC_MSG_CHECKING(for GCC atomic builtins)
+dnl Since we'll be using these atomic builtins in C++ files we should test
+dnl the C++ compiler.
+AC_LANG_PUSH([C++])
 AC_LINK_IFELSE(
   AC_LANG_SOURCE(
     [[int main() {
@@ -1366,6 +1369,7 @@ AC_LINK_IFELSE(
         return 0;
       }
     ]]),
+  AC_LANG_POP([C++])
   AC_MSG_RESULT(yes)
   AC_DEFINE(LLVM_MULTITHREADED, 1, Build multithreading support into LLVM),
   AC_MSG_RESULT(no)