From owner-svn-src-stable-9@FreeBSD.ORG Fri Dec 30 22:07:05 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61CE2106566C; Fri, 30 Dec 2011 22:07:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F12F8FC15; Fri, 30 Dec 2011 22:07:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBUM75qs032907; Fri, 30 Dec 2011 22:07:05 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBUM75PQ032903; Fri, 30 Dec 2011 22:07:05 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201112302207.pBUM75PQ032903@svn.freebsd.org> From: Dimitry Andric Date: Fri, 30 Dec 2011 22:07:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229037 - in stable/9: gnu/lib/libstdc++ lib/clang/include/llvm/Config X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2011 22:07:05 -0000 Author: dim Date: Fri Dec 30 22:07:04 2011 New Revision: 229037 URL: http://svn.freebsd.org/changeset/base/229037 Log: MFC r227215: 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. MFC r227538: LLVM uses atomic operations, which are not supported on i386 and GCC emits calls for them, rather than expanding them inline. Older FreeBSD versions compile for i386 by default and as such we end up with unresolved symbols when we build LLVM's TableGen utility as a build tool on them. Add the functions that GCC emits here, but don't bother to make them atomic. Such is not needed. Submitted by: marcel MFC r227636: Revert r227538, since it doesn't compile with clang at all (it doesn't allow the built-in operations to be redefined, at least not without excessive force). Instead, just disable LLVM's support for atomic operations for now. Nothing in either clang or the tablegen tools currently depends on it. This still allows users of head built before r198344 to upgrade to top-of-head seamlessly. Modified: stable/9/gnu/lib/libstdc++/config.h stable/9/lib/clang/include/llvm/Config/config.h stable/9/lib/clang/include/llvm/Config/llvm-config.h Directory Properties: stable/9/gnu/lib/ (props changed) stable/9/lib/clang/ (props changed) stable/9/tools/ (props changed) Modified: stable/9/gnu/lib/libstdc++/config.h ============================================================================== --- stable/9/gnu/lib/libstdc++/config.h Fri Dec 30 21:50:16 2011 (r229036) +++ stable/9/gnu/lib/libstdc++/config.h Fri Dec 30 22:07:04 2011 (r229037) @@ -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: stable/9/lib/clang/include/llvm/Config/config.h ============================================================================== --- stable/9/lib/clang/include/llvm/Config/config.h Fri Dec 30 21:50:16 2011 (r229036) +++ stable/9/lib/clang/include/llvm/Config/config.h Fri Dec 30 22:07:04 2011 (r229037) @@ -552,7 +552,7 @@ /* #undef LLVM_ETCDIR */ /* Has gcc/MSVC atomic intrinsics */ -#define LLVM_HAS_ATOMICS 1 +#define LLVM_HAS_ATOMICS 0 /* Host triple we were built on */ /* #undef LLVM_HOSTTRIPLE */ Modified: stable/9/lib/clang/include/llvm/Config/llvm-config.h ============================================================================== --- stable/9/lib/clang/include/llvm/Config/llvm-config.h Fri Dec 30 21:50:16 2011 (r229036) +++ stable/9/lib/clang/include/llvm/Config/llvm-config.h Fri Dec 30 22:07:04 2011 (r229037) @@ -34,7 +34,7 @@ /* #undef LLVM_ETCDIR */ /* Has gcc/MSVC atomic intrinsics */ -#define LLVM_HAS_ATOMICS 1 +#define LLVM_HAS_ATOMICS 0 /* Host triple we were built on */ /* #undef LLVM_HOSTTRIPLE */