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

Evangelos Foutras foutrelis at archlinux.org
Mon Dec 5 04:48:10 UTC 2011


    Date: Sunday, December 4, 2011 @ 23:48:10
  Author: foutrelis
Revision: 144359

upgpkg: llvm 3.0-1

New upstream release.

Added:
  llvm/trunk/fix-gold-lto-linking.patch
Modified:
  llvm/trunk/PKGBUILD
  llvm/trunk/clang-pure64.patch
  llvm/trunk/enable-lto.patch
Deleted:
  llvm/trunk/bug-9869-operator-h-c++0x.patch
  llvm/trunk/clang-toolchains-gcc-versions.patch

-------------------------------------+
 PKGBUILD                            |   86 ++++++++++------------------------
 bug-9869-operator-h-c++0x.patch     |   57 ----------------------
 clang-pure64.patch                  |   29 -----------
 clang-toolchains-gcc-versions.patch |   12 ----
 enable-lto.patch                    |   18 ++-----
 fix-gold-lto-linking.patch          |   11 ++++
 6 files changed, 47 insertions(+), 166 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2011-12-05 03:45:19 UTC (rev 144358)
+++ PKGBUILD	2011-12-05 04:48:10 UTC (rev 144359)
@@ -10,39 +10,34 @@
 # Contributor: Gerardo Exequiel Pozzi <vmlinuz386 at yahoo.com.ar>
 
 pkgname=('llvm' 'llvm-ocaml' 'clang' 'clang-analyzer')
-pkgver=2.9
-_gcc_ver=4.6.2
-pkgrel=7
+pkgver=3.0
+pkgrel=1
 arch=('i686' 'x86_64')
 url="http://llvm.org/"
 license=('custom:University of Illinois/NCSA Open Source License')
-makedepends=('gcc-libs' 'libffi' 'python2' 'ocaml' "gcc=$_gcc_ver")
-source=(http://llvm.org/releases/$pkgver/$pkgname-$pkgver.tgz
-        http://llvm.org/releases/$pkgver/clang-$pkgver.tgz
-        ftp://ftp.archlinux.org/other/community/clang/gcc-headers-4.5.2.tar.xz
+makedepends=('libffi' 'python2' 'ocaml')
+source=(http://llvm.org/releases/$pkgver/$pkgname-$pkgver.tar.gz
+        http://llvm.org/releases/$pkgver/clang-$pkgver.tar.gz
         clang-plugin-loader-registry.patch
         cindexer-clang-path.patch
-        clang-toolchains-gcc-versions.patch
         clang-pure64.patch
         enable-lto.patch
-        bug-9869-operator-h-c++0x.patch)
-sha256sums=('661236cfa17428b48cfa9cbb9909f7569c64b8ecd219fd91dbc00e3b557b3779'
-            '70c41f3f782a71cbaa7bc8d6ea29fce4263ad3e8558dfecc6dc11cdef17909df'
-            '12cf0bfb128cd8bd2a308c3c03cf0e607aa47bd87d9a58b422b96bd387e476c1'
+        fix-gold-lto-linking.patch)
+sha256sums=('519eb11d3499ce99c6ffdb8718651fc91425ed7690eac91c8d6853474f7c0477'
+            'b64e72da356d7c3428cfd7ac620d49ec042c84eaee13c26024879f555f4e126d'
             'a0a4494f2a692789670be37fd390906dcaa37b1824f740bdaaea21182f2f3a9c'
             '3074df5322900e087377a8e03a02115463ccc0011c25917c2f06df11facd9b92'
-            '7c05788c02697f0cd05f7c74fe65b460530c0748851313eb950c5d4d17a8115a'
-            '5bba4964d0d832c9e97308beb45244ff6ed4e16ed3f9f771babe571f1b82fa33'
-            '1a308679edf3078b8f0c33c94d4e6d0c0db6d3baad91babce08bf5370aa052ef'
-            '1c37346b0f412556dc979fd510585f3e20d2d45319ec095dbdec37a582d590c7')
+            '288a82fbff17bc554f5863734246500e637882af33ee8511019d5e0d6cd20524'
+            'cf8922a932e1859f3783bef2af8ac1e90ce96f8eec79928392327b71b3d7cb89'
+            '24d275cdf170f53844bc7174b065fb51b6ddbb9642ced34702cde1f0f74d9192')
 
 build() {
-  cd "$srcdir/$pkgname-$pkgver"
+  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" tools/clang
+  cp -r "$srcdir/clang-$pkgver.src" tools/clang
 
   # Fix symbolic links from OCaml bindings to LLVM libraries
   sed -i 's:\$(PROJ_libdir):/usr/lib/llvm:' bindings/ocaml/Makefile.ocaml
@@ -63,11 +58,8 @@
   # Fix clang path in CIndexer.cpp (https://bugs.archlinux.org/task/22799)
   patch -d tools/clang -Np0 -i "$srcdir/cindexer-clang-path.patch"
 
-  # Add GCC 4.6.1 to GccVersions (FS#23631)
-  patch -d tools/clang -Np1 -i "$srcdir/clang-toolchains-gcc-versions.patch"
-
   if [[ $CARCH == x86_64 ]]; then
-    # Adjust lib paths
+    # Adjust linker path
     patch -d tools/clang -Np0 -i "$srcdir/clang-pure64.patch"
   fi
 
@@ -75,9 +67,8 @@
   # Use gold instead of default linker, and always use the plugin
   patch -d tools/clang -Np0 -i "$srcdir/enable-lto.patch"
 
-  # Fix upstream bug #9869:
-  #   Operator.h incompatibility with GCC 4.6 in C++0x mode
-  patch -Np2 -i "$srcdir/bug-9869-operator-h-c++0x.patch"
+  # Fix libLTO.so location in gold plugin
+  patch -Np1 -i "$srcdir/fix-gold-lto-linking.patch"
 
   # Apply strip option to configure
   _optimized_switch="enable"
@@ -86,20 +77,8 @@
   # Include location of libffi headers in CPPFLAGS
   export CPPFLAGS="$CPPFLAGS $(pkg-config --cflags libffi)"
 
-  # TODO: Uncomment when clang works with GCC 4.6+
-  #_cxx_headers="/usr/include/c++/$_gcc_ver"
-  #if [[ ! -d $_cxx_headers ]]; then
-  #  error "Couldn't find the C++ headers, PKGBUILD needs fixing!"
-  #  return 1
-  #fi
-  _cxx_headers="/usr/include/c++/clang-$pkgver"
-
-  _32bit_headers=""
-  if [[ $CARCH == x86_64 ]]; then
-    # Important for multilib
-    _32bit_headers="32"
-  fi
-
+  # Force the use of GCC instead of clang
+  CC=gcc CXX=g++ \
   ./configure \
     --prefix=/usr \
     --libdir=/usr/lib/llvm \
@@ -111,9 +90,6 @@
     --disable-debug-runtime \
     --disable-assertions \
     --with-binutils-include=/usr/include \
-    --with-cxx-include-root=$_cxx_headers \
-    --with-cxx-include-arch=$CHOST \
-    --with-cxx-include-32bit-dir=$_32bit_headers \
     --$_optimized_switch-optimized
 
   make REQUIRES_RTTI=1
@@ -123,11 +99,13 @@
   pkgdesc="Low Level Virtual Machine"
   depends=('perl' 'libffi')
 
-  cd "$srcdir/$pkgname-$pkgver"
+  cd "$srcdir/$pkgname-$pkgver.src"
 
   # We move the clang directory out of the tree so it won't get installed and
   # then we bring it back in for the clang package
   mv tools/clang "$srcdir"
+  # Copy missing file into the expected location
+  cp bindings/ocaml/llvm/META.llvm bindings/ocaml/llvm/Release/
   # -j1 is due to race conditions during the installation of the OCaml bindings
   make -j1 DESTDIR="$pkgdir" install
   mv "$srcdir/clang" tools
@@ -148,9 +126,6 @@
   # Get rid of example Hello transformation
   rm "$pkgdir"/usr/lib/llvm/*LLVMHello.*
 
-  # Symlink the gold plugin where clang expects it
-  ln -s llvm/LLVMgold.so "$pkgdir/usr/lib/LLVMgold.so"
-
   # Add ld.so.conf.d entry
   install -d "$pkgdir/etc/ld.so.conf.d"
   echo /usr/lib/llvm >"$pkgdir/etc/ld.so.conf.d/llvm.conf"
@@ -162,7 +137,7 @@
   pkgdesc="OCaml bindings for LLVM"
   depends=("llvm=$pkgver-$pkgrel" 'ocaml')
 
-  cd "$srcdir/llvm-$pkgver"
+  cd "$srcdir/llvm-$pkgver.src"
 
   install -d "$pkgdir"/{usr/lib,usr/share/doc/llvm}
   cp -r "$srcdir/ocaml" "$pkgdir/usr/lib"
@@ -177,15 +152,13 @@
 package_clang() {
   pkgdesc="C language family frontend for LLVM"
   url="http://clang.llvm.org/"
-  # It looks like clang still needs GCC to assemble and link object files
-  # See http://old.nabble.com/%22clang--v%22-shows-a-GCC-call-td28378453.html
-  depends=("llvm=$pkgver-$pkgrel" "gcc=$_gcc_ver")
+  depends=("llvm=$pkgver-$pkgrel" 'gcc')
 
   # Fix installation path for clang docs
   sed -i 's:$(PROJ_prefix)/share/doc/llvm:$(PROJ_prefix)/share/doc/clang:' \
-    "$srcdir/llvm-$pkgver/Makefile.config"
+    "$srcdir/llvm-$pkgver.src/Makefile.config"
 
-  cd "$srcdir/llvm-$pkgver/tools/clang"
+  cd "$srcdir/llvm-$pkgver.src/tools/clang"
   make DESTDIR="$pkgdir" install
 
   # Fix permissions of static libs
@@ -193,13 +166,8 @@
 
   # Revert the path change in case we want to do a repackage later
   sed -i 's:$(PROJ_prefix)/share/doc/clang:$(PROJ_prefix)/share/doc/llvm:' \
-    "$srcdir/llvm-$pkgver/Makefile.config"
+    "$srcdir/llvm-$pkgver.src/Makefile.config"
 
-  # Install old libstdc++ headers. Contains combined headers from
-  # gcc 4.5.2-6-i686 and gcc-multilib-4.5.2-6-x86_64
-  install -d "$pkgdir/usr/include/c++"
-  cp -rd "$srcdir/gcc-headers-4.5.2" "$pkgdir/usr/include/c++/clang-$pkgver"
-
   install -Dm644 LICENSE.TXT "$pkgdir/usr/share/licenses/clang/LICENSE"
 }
 
@@ -208,7 +176,7 @@
   url="http://clang-analyzer.llvm.org/"
   depends=("clang=$pkgver-$pkgrel" 'python2')
 
-  cd "$srcdir/llvm-$pkgver/tools/clang"
+  cd "$srcdir/llvm-$pkgver.src/tools/clang"
 
   install -d "$pkgdir"/usr/{bin,lib/clang-analyzer}
   for _tool in scan-{build,view}; do

Deleted: bug-9869-operator-h-c++0x.patch
===================================================================
--- bug-9869-operator-h-c++0x.patch	2011-12-05 03:45:19 UTC (rev 144358)
+++ bug-9869-operator-h-c++0x.patch	2011-12-05 04:48:10 UTC (rev 144359)
@@ -1,57 +0,0 @@
---- llvm/trunk/include/llvm/Operator.h	2011/02/07 16:40:21	125006
-+++ llvm/trunk/include/llvm/Operator.h	2011/05/08 01:59:22	131062
-@@ -186,28 +186,46 @@
- };
- 
- class AddOperator
--  : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Add> {};
-+  : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Add> {
-+  ~AddOperator(); // DO NOT IMPLEMENT
-+};
- class SubOperator
--  : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Sub> {};
-+  : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Sub> {
-+  ~SubOperator(); // DO NOT IMPLEMENT
-+};
- class MulOperator
--  : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Mul> {};
-+  : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Mul> {
-+  ~MulOperator(); // DO NOT IMPLEMENT
-+};
- class ShlOperator
--  : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Shl> {};
-+  : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Shl> {
-+  ~ShlOperator(); // DO NOT IMPLEMENT
-+};
- 
-   
- class SDivOperator
--  : public ConcreteOperator<PossiblyExactOperator, Instruction::SDiv> {};
-+  : public ConcreteOperator<PossiblyExactOperator, Instruction::SDiv> {
-+  ~SDivOperator(); // DO NOT IMPLEMENT
-+};
- class UDivOperator
--  : public ConcreteOperator<PossiblyExactOperator, Instruction::UDiv> {};
-+  : public ConcreteOperator<PossiblyExactOperator, Instruction::UDiv> {
-+  ~UDivOperator(); // DO NOT IMPLEMENT
-+};
- class AShrOperator
--  : public ConcreteOperator<PossiblyExactOperator, Instruction::AShr> {};
-+  : public ConcreteOperator<PossiblyExactOperator, Instruction::AShr> {
-+  ~AShrOperator(); // DO NOT IMPLEMENT
-+};
- class LShrOperator
--  : public ConcreteOperator<PossiblyExactOperator, Instruction::LShr> {};
-+  : public ConcreteOperator<PossiblyExactOperator, Instruction::LShr> {
-+  ~LShrOperator(); // DO NOT IMPLEMENT
-+};
-   
-   
-   
- class GEPOperator
-   : public ConcreteOperator<Operator, Instruction::GetElementPtr> {
-+  ~GEPOperator(); // DO NOT IMPLEMENT
-+
-   enum {
-     IsInBounds = (1 << 0)
-   };

Modified: clang-pure64.patch
===================================================================
--- clang-pure64.patch	2011-12-05 03:45:19 UTC (rev 144358)
+++ clang-pure64.patch	2011-12-05 04:48:10 UTC (rev 144359)
@@ -3,36 +3,11 @@
 --- lib/Driver/Tools.cpp	(revision 123373)
 +++ lib/Driver/Tools.cpp	(working copy)
 @@ -3306,7 +3306,7 @@
-     else if (ToolChain.getArch() == llvm::Triple::arm)
-       CmdArgs.push_back("/lib/ld-linux.so.3");
+     else if (ToolChain.getArch() == llvm::Triple::ppc64)
+       CmdArgs.push_back("/lib64/ld64.so.1");
      else
 -      CmdArgs.push_back("/lib64/ld-linux-x86-64.so.2");
 +      CmdArgs.push_back("/lib/ld-linux-x86-64.so.2");
    }
  
    CmdArgs.push_back("-o");
-Index: lib/Driver/ToolChains.cpp
-===================================================================
---- lib/Driver/ToolChains.cpp	(revision 123373)
-+++ lib/Driver/ToolChains.cpp	(working copy)
-@@ -1317,18 +1317,10 @@
-   if (Arch == llvm::Triple::x86)
-     Suffix64 = "/64";
- 
--  std::string Lib32 = "lib";
--
--  bool Exists;
--  if (!llvm::sys::fs::exists("/lib32", Exists) && Exists)
--    Lib32 = "lib32";
--
-+  std::string Lib32 = "lib32";
-   std::string Lib64 = "lib";
--  bool Symlink;
--  if (!llvm::sys::fs::exists("/lib64", Exists) && Exists &&
--      (llvm::sys::fs::is_symlink("/lib64", Symlink) || !Symlink))
--    Lib64 = "lib64";
- 
-+  bool Exists;
-   std::string GccTriple = "";
-   if (Arch == llvm::Triple::arm) {
-     if (!llvm::sys::fs::exists("/usr/lib/gcc/arm-linux-gnueabi", Exists) &&

Deleted: clang-toolchains-gcc-versions.patch
===================================================================
--- clang-toolchains-gcc-versions.patch	2011-12-05 03:45:19 UTC (rev 144358)
+++ clang-toolchains-gcc-versions.patch	2011-12-05 04:48:10 UTC (rev 144359)
@@ -1,12 +0,0 @@
-diff -upr clang-2.9.orig/lib/Driver/ToolChains.cpp clang-2.9/lib/Driver/ToolChains.cpp
---- clang-2.9.orig/lib/Driver/ToolChains.cpp	2011-03-21 23:29:27.000000000 +0200
-+++ clang-2.9/lib/Driver/ToolChains.cpp	2011-04-08 00:03:34.000000000 +0300
-@@ -1449,7 +1449,7 @@ Linux::Linux(const HostInfo &Host, const
-       GccTriple = "i586-suse-linux";
-   }
- 
--  const char* GccVersions[] = {"4.5.2", "4.5.1", "4.5", "4.4.5", "4.4.4",
-+  const char* GccVersions[] = {"4.6.2", "4.5.2", "4.5.1", "4.5", "4.4.5", "4.4.4",
-                                "4.4.3", "4.4", "4.3.4", "4.3.3", "4.3.2",
-                                "4.3", "4.2.4", "4.2.3", "4.2.2", "4.2.1",
-                                "4.2"};

Modified: enable-lto.patch
===================================================================
--- enable-lto.patch	2011-12-05 03:45:19 UTC (rev 144358)
+++ enable-lto.patch	2011-12-05 04:48:10 UTC (rev 144359)
@@ -2,17 +2,12 @@
 ===================================================================
 --- lib/Driver/ToolChains.cpp	(revision 123373)
 +++ lib/Driver/ToolChains.cpp	(working copy)
-@@ -1398,11 +1398,11 @@
-     Lib = Lib64;
-   }
+@@ -1398,7 +1398,7 @@
+   PPaths.push_back(Twine(GCCInstallation.getParentLibPath() + "/../" +
+                          GCCInstallation.getTriple() + "/bin").str());
  
--  llvm::sys::Path LinkerPath(Base + "/../../../../" + GccTriple + "/bin/ld");
-+  llvm::sys::Path LinkerPath(Base + "/../../../../" + GccTriple + "/bin/ld.gold");
-   if (!llvm::sys::fs::exists(LinkerPath.str(), Exists) && Exists)
-     Linker = LinkerPath.str();
-   else
--    Linker = GetProgramPath("ld");
-+    Linker = GetProgramPath("ld.gold");
+-  Linker = GetProgramPath("ld");
++  Linker = GetProgramPath("ld.gold");
  
    LinuxDistro Distro = DetectLinuxDistro(Arch);
  
@@ -27,7 +22,8 @@
 -  if (Args.hasArg(options::OPT_use_gold_plugin)) {
 +  // if (Args.hasArg(options::OPT_use_gold_plugin)) {
      CmdArgs.push_back("-plugin");
-     std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so";
+-    std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so";
++    std::string Plugin = ToolChain.getDriver().Dir + "/../lib/llvm/LLVMgold.so";
      CmdArgs.push_back(Args.MakeArgString(Plugin));
 -  }
 +  // }

Added: fix-gold-lto-linking.patch
===================================================================
--- fix-gold-lto-linking.patch	                        (rev 0)
+++ fix-gold-lto-linking.patch	2011-12-05 04:48:10 UTC (rev 144359)
@@ -0,0 +1,11 @@
+diff -upr llvm-3.0.src.orig/tools/gold/Makefile llvm-3.0.src/tools/gold/Makefile
+--- llvm-3.0.src.orig/tools/gold/Makefile	2011-05-31 23:00:45.000000000 +0300
++++ llvm-3.0.src/tools/gold/Makefile	2011-12-04 22:06:59.000000000 +0200
+@@ -26,6 +26,6 @@ LINK_COMPONENTS := support
+ # Because off_t is used in the public API, the largefile parts are required for
+ # ABI compatibility.
+ CXXFLAGS+=-I$(BINUTILS_INCDIR) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+-CXXFLAGS+=$(SharedLibDir)/$(SharedPrefix)LTO$(SHLIBEXT)
++CXXFLAGS+=-L $(SharedLibDir) -lLTO
+ 
+ include $(LEVEL)/Makefile.common




More information about the arch-commits mailing list