From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 14:07:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FE09106566C; Sun, 6 Nov 2011 14:07:23 +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 75EA88FC18; Sun, 6 Nov 2011 14:07:23 +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 pA6E7N6v024807; Sun, 6 Nov 2011 14:07:23 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6E7NQG024803; Sun, 6 Nov 2011 14:07:23 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201111061407.pA6E7NQG024803@svn.freebsd.org> From: Dimitry Andric Date: Sun, 6 Nov 2011 14:07:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227215 - in head: gnu/lib/libstdc++ lib/clang/include/llvm/Config X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 14:07:23 -0000 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 */