diff options
Diffstat (limited to 'extra/llvm')
-rw-r--r-- | extra/llvm/PKGBUILD | 33 | ||||
-rw-r--r-- | extra/llvm/clang-3.2-fix-std-thread-with-libstdc++.patch | 17 |
2 files changed, 39 insertions, 11 deletions
diff --git a/extra/llvm/PKGBUILD b/extra/llvm/PKGBUILD index d1642a983..b354261ca 100644 --- a/extra/llvm/PKGBUILD +++ b/extra/llvm/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 176908 2013-02-02 12:44:44Z foutrelis $ +# $Id: PKGBUILD 183300 2013-04-20 23:37:12Z foutrelis $ # Maintainer: Evangelos Foutras <evangelos@foutrelis.com> # Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com> # Contributor: Sebastian Nowicki <sebnow@gmail.com> @@ -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,8 +24,9 @@ source=(http://llvm.org/releases/$pkgver/$pkgname-$pkgver.src.tar.gz 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=('378f9ed7126409785aa399bf367762753dbda563b60612dae1a92d5263ab8130' +sha256sums=('125090c4d26740f1d5e9838477c931ed7d9ad70d599ba265f46f3a42cb066343' '2aaaf03f7c0f6b16fe97ecc81247dc2bf2d4bec7620a77cc74670b7e07ff5658' 'a9a6b73a1bd5fc763f3b3826a6ce796cb150042d37d319e06e72d3d9778aaac1' '312574e655f9a87784ca416949c505c452b819fad3061f2cde8aced6540a19a3' @@ -33,18 +34,17 @@ sha256sums=('378f9ed7126409785aa399bf367762753dbda563b60612dae1a92d5263ab8130' '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 @@ build() { # 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 @@ build() { # 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 diff --git a/extra/llvm/clang-3.2-fix-std-thread-with-libstdc++.patch b/extra/llvm/clang-3.2-fix-std-thread-with-libstdc++.patch new file mode 100644 index 000000000..6963603b1 --- /dev/null +++ b/extra/llvm/clang-3.2-fix-std-thread-with-libstdc++.patch @@ -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 { |