[arch-commits] Commit in llvm/trunk (2 files)

Evangelos Foutras foutrelis at nymeria.archlinux.org
Sat Apr 20 23:07:21 UTC 2013


    Date: Sunday, April 21, 2013 @ 01:07:20
  Author: foutrelis
Revision: 183297

upgpkg: llvm 3.2-6

Fix FS#34861: crash on apps built using C++11's std::thread.

Added:
  llvm/trunk/clang-3.2-fix-std-thread-with-libstdc++.patch
Modified:
  llvm/trunk/PKGBUILD

-----------------------------------------------+
 PKGBUILD                                      |   29 ++++++++++++++++--------
 clang-3.2-fix-std-thread-with-libstdc++.patch |   17 ++++++++++++++
 2 files changed, 37 insertions(+), 9 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2013-04-20 16:41:36 UTC (rev 183296)
+++ PKGBUILD	2013-04-20 23:07:20 UTC (rev 183297)
@@ -11,7 +11,7 @@
 
 pkgname=('llvm' 'llvm-ocaml' 'clang' 'clang-analyzer')
 pkgver=3.2
-pkgrel=5
+pkgrel=6
 arch=('i686' 'x86_64')
 url="http://llvm.org/"
 license=('custom:University of Illinois/NCSA Open Source License')
@@ -24,6 +24,7 @@
         cindexer-clang-path.patch
         enable-lto.patch
         llvm-3.1-fix-debug-line-info.patch
+        clang-3.2-fix-std-thread-with-libstdc++.patch
         clang-3.1-fix-libprofile_rt.a-location.patch)
 sha256sums=('125090c4d26740f1d5e9838477c931ed7d9ad70d599ba265f46f3a42cb066343'
             '2aaaf03f7c0f6b16fe97ecc81247dc2bf2d4bec7620a77cc74670b7e07ff5658'
@@ -33,18 +34,17 @@
             '3074df5322900e087377a8e03a02115463ccc0011c25917c2f06df11facd9b92'
             'fe3969d9ec93263814d9892a15b6a1eb60ad756fe7c3985a45d8cd82bc9b7a7b'
             'db1f1aadebbc4c4232bdad49fb9b7dc61eac727085c63154b870fa9ce64fd18d'
+            '02b2c0fd29bc165140eb4524700254bfdd88369706719acb3f3be3134f1e67e8'
             '0d32ad283566357ca1bfbeb4cbe6b0b961943b79d3d718ed0435101c05629137')
 
-build() {
+prepare() {
   cd "$srcdir/$pkgname-$pkgver.src"
 
   # At the present, clang must reside inside the LLVM source code tree to build
   # See http://llvm.org/bugs/show_bug.cgi?id=4840
-  rm -rf tools/clang
-  cp -r "$srcdir/clang-$pkgver.src" tools/clang
+  mv "$srcdir/clang-$pkgver.src" tools/clang
 
-  rm -rf projects/compiler-rt
-  cp -r "$srcdir/compiler-rt-$pkgver.src" projects/compiler-rt
+  mv "$srcdir/compiler-rt-$pkgver.src" projects/compiler-rt
 
   # Fix symbolic links from OCaml bindings to LLVM libraries
   sed -i 's:\$(PROJ_libdir):/usr/lib/llvm:' bindings/ocaml/Makefile.ocaml
@@ -70,6 +70,11 @@
   # Use gold instead of default linker, and always use the plugin
   patch -d tools/clang -Np0 -i "$srcdir/enable-lto.patch"
 
+  # Fix FS#34861: crash on apps built using C++11's std::thread
+  # http://llvm.org/bugs/show_bug.cgi?id=12730
+  patch -d tools/clang -Np2 -i \
+    "$srcdir/clang-3.2-fix-std-thread-with-libstdc++.patch"
+
   # Fix FS#29984: [clang] -coverage is broken
   patch -d tools/clang -Np1 -i \
     "$srcdir/clang-3.1-fix-libprofile_rt.a-location.patch"
@@ -81,16 +86,22 @@
   # Drop "svn" suffix from version string
   sed -i 's/3\.2svn/3.2/g' configure
 
+  # Prepare Python 2 override
+  mkdir "$srcdir/python2-path"
+  ln -s /usr/bin/python2 "$srcdir/python2-path/python"
+}
+
+build() {
+  cd "$srcdir/$pkgname-$pkgver.src"
+
   # Apply strip option to configure
   _optimized_switch="enable"
   [[ $(check_option strip) == n ]] && _optimized_switch="disable"
 
   # Include location of libffi headers in CPPFLAGS
-  export CPPFLAGS="$CPPFLAGS $(pkg-config --cflags libffi)"
+  CPPFLAGS+=" $(pkg-config --cflags libffi)"
 
   # Use Python 2
-  mkdir "$srcdir/python2-path"
-  ln -s /usr/bin/python2 "$srcdir/python2-path/python"
   export PATH="$srcdir/python2-path:$PATH"
 
   # Force the use of GCC instead of clang

Added: clang-3.2-fix-std-thread-with-libstdc++.patch
===================================================================
--- clang-3.2-fix-std-thread-with-libstdc++.patch	                        (rev 0)
+++ clang-3.2-fix-std-thread-with-libstdc++.patch	2013-04-20 23:07:20 UTC (rev 183297)
@@ -0,0 +1,17 @@
+--- cfe/trunk/lib/Basic/Targets.cpp	2013/04/04 23:51:36	178815
++++ cfe/trunk/lib/Basic/Targets.cpp	2013/04/04 23:53:43	178816
+@@ -2730,6 +2730,14 @@
+   case NoMMX3DNow:
+     break;
+   }
++
++  if (CPU >= CK_i486) {
++    Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");
++    Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");
++    Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4");
++  }
++  if (CPU >= CK_i586)
++    Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8");
+ }
+ 
+ bool X86TargetInfo::hasFeature(StringRef Feature) const {




More information about the arch-commits mailing list