Date: Sun, 6 Nov 2011 14:07:23 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r227215 - in head: gnu/lib/libstdc++ lib/clang/include/llvm/Config Message-ID: <201111061407.pA6E7NQG024803@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Sun Nov 6 14:07:23 2011 New Revision: 227215 URL: http://svn.freebsd.org/changeset/base/227215 Log: 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. Modified: head/gnu/lib/libstdc++/config.h head/lib/clang/include/llvm/Config/config.h head/lib/clang/include/llvm/Config/llvm-config.h Modified: head/gnu/lib/libstdc++/config.h ============================================================================== --- head/gnu/lib/libstdc++/config.h Sun Nov 6 14:00:18 2011 (r227214) +++ head/gnu/lib/libstdc++/config.h Sun Nov 6 14:07:23 2011 (r227215) @@ -671,7 +671,7 @@ /* #undef VERSION */ /* Define if builtin atomic operations are supported on this host. */ -#if defined(__amd64__) || defined(__i386__) +#if defined(__amd64__) || (defined(__i386__) && !defined(__tune_i386__)) #define _GLIBCXX_ATOMIC_BUILTINS 1 #endif Modified: head/lib/clang/include/llvm/Config/config.h ============================================================================== --- head/lib/clang/include/llvm/Config/config.h Sun Nov 6 14:00:18 2011 (r227214) +++ head/lib/clang/include/llvm/Config/config.h Sun Nov 6 14:07:23 2011 (r227215) @@ -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 */ Modified: head/lib/clang/include/llvm/Config/llvm-config.h ============================================================================== --- head/lib/clang/include/llvm/Config/llvm-config.h Sun Nov 6 14:00:18 2011 (r227214) +++ head/lib/clang/include/llvm/Config/llvm-config.h Sun Nov 6 14:07:23 2011 (r227215) @@ -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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111061407.pA6E7NQG024803>