aboutsummaryrefslogtreecommitdiff
path: root/lib/clang/include
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2011-11-06 14:07:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2011-11-06 14:07:23 +0000
commit130515293b34058d9f48fd431657b1d8d7a6a5c0 (patch)
treefa91394f6c2cb70ed6b8ba7066b85e3fb9376e3f /lib/clang/include
parent393404f7d9e8d84ebe7d2871e01ea8ce28b7b408 (diff)
downloadsrc-130515293b34058d9f48fd431657b1d8d7a6a5c0.tar.gz
src-130515293b34058d9f48fd431657b1d8d7a6a5c0.zip
When one attempts to compile the tree with -march=i386, which also used
to be gcc's default before r198344, calls to atomic builtins will not be expanded inline. Instead, they will be generated as calls to external functions (e.g. __sync_fetch_and_add_N), leading to linking errors later on. Put in a seatbelt that disables use of atomic builtins in libstdc++ and llvm, when tuning specifically for the real i386 CPU. This does not protect against all possible issues, but it is better than nothing.
Notes
Notes: svn path=/head/; revision=227215
Diffstat (limited to 'lib/clang/include')
-rw-r--r--lib/clang/include/llvm/Config/config.h2
-rw-r--r--lib/clang/include/llvm/Config/llvm-config.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/clang/include/llvm/Config/config.h b/lib/clang/include/llvm/Config/config.h
index 5b6761c2eeaa..5ecb51ca0dd3 100644
--- a/lib/clang/include/llvm/Config/config.h
+++ b/lib/clang/include/llvm/Config/config.h
@@ -552,7 +552,9 @@
/* #undef LLVM_ETCDIR */
/* Has gcc/MSVC atomic intrinsics */
+#ifndef __tune_i386__
#define LLVM_HAS_ATOMICS 1
+#endif
/* Host triple we were built on */
/* #undef LLVM_HOSTTRIPLE */
diff --git a/lib/clang/include/llvm/Config/llvm-config.h b/lib/clang/include/llvm/Config/llvm-config.h
index 05e17ca1fd90..28837f787e96 100644
--- a/lib/clang/include/llvm/Config/llvm-config.h
+++ b/lib/clang/include/llvm/Config/llvm-config.h
@@ -34,7 +34,9 @@
/* #undef LLVM_ETCDIR */
/* Has gcc/MSVC atomic intrinsics */
+#ifndef __tune_i386__
#define LLVM_HAS_ATOMICS 1
+#endif
/* Host triple we were built on */
/* #undef LLVM_HOSTTRIPLE */