Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Dec 2011 22:07:05 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r229037 - in stable/9: gnu/lib/libstdc++ lib/clang/include/llvm/Config
Message-ID:  <201112302207.pBUM75PQ032903@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201112302207.pBUM75PQ032903>