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

Evangelos Foutras foutrelis at archlinux.org
Wed Sep 16 11:29:38 UTC 2015


    Date: Wednesday, September 16, 2015 @ 13:29:38
  Author: foutrelis
Revision: 246402

Prepare LLVM 3.7.0

Known issues:

 - Upstream removed support for building sanitizers using autotools; as
   such, the various libclang_rt.*.a libraries are not included anymore.

 - Switching to the CMake build system will be delayed until LLVM 3.8
   since LLVM_LINK_LLVM_DYLIB was introduced after 3.7 was tagged and
   we need that in order to avoid huge binaries.

Modified:
  llvm/trunk/PKGBUILD
Deleted:
  llvm/trunk/llvm-3.6.0-use-ocamlfind-for-ocamldoc.patch
  llvm/trunk/llvm-ocaml-ctypes-0.4.patch

---------------------------------------------+
 PKGBUILD                                    |  117 ++++++++++++--------------
 llvm-3.6.0-use-ocamlfind-for-ocamldoc.patch |   30 ------
 llvm-ocaml-ctypes-0.4.patch                 |   75 ----------------
 3 files changed, 58 insertions(+), 164 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2015-09-16 08:57:08 UTC (rev 246401)
+++ PKGBUILD	2015-09-16 11:29:38 UTC (rev 246402)
@@ -11,8 +11,8 @@
 
 pkgname=('llvm' 'llvm-libs' 'llvm-ocaml' 'lldb' 'clang' 'clang-analyzer'
          'clang-tools-extra')
-pkgver=3.6.2
-pkgrel=4
+pkgver=3.7.0
+pkgrel=0
 _ocaml_ver=4.02.3
 arch=('i686' 'x86_64')
 url="http://llvm.org/"
@@ -27,25 +27,22 @@
         http://llvm.org/releases/$pkgver/clang-tools-extra-$pkgver.src.tar.xz{,.sig}
         http://llvm.org/releases/$pkgver/compiler-rt-$pkgver.src.tar.xz{,.sig}
         http://llvm.org/releases/$pkgver/lldb-$pkgver.src.tar.xz{,.sig}
-        llvm-3.6.0-use-ocamlfind-for-ocamldoc.patch
-        llvm-ocaml-ctypes-0.4.patch
         llvm-Config-config.h
         llvm-Config-llvm-config.h)
-sha256sums=('f60dc158bfda6822de167e87275848969f0558b3134892ff54fced87e4667b94'
+sha256sums=('ab45895f9dcdad1e140a3a79fd709f64b05ad7364e308c0e582c5b02e9cc3153'
             'SKIP'
-            'ae9180466a23acb426d12444d866b266ff2289b266064d362462e44f8d4699f3'
+            '4ed740c5a91df1c90a4118c5154851d6a475f39a91346bdf268c1c29c13aa1cc'
             'SKIP'
-            '6a0ec627d398f501ddf347060f7a2ccea4802b2494f1d4fd7bda3e0442d04feb'
+            '8ae8a0a3a96b7a700412d67df0af172cb2fc1326beec575fcc0f71d2e72709cd'
             'SKIP'
-            '0f2ff37d80a64575fecd8cf0d5c50f7ac1f837ddf700d1855412bb7547431d87'
+            '227fa998520bc94974a428dc8e7654d9bdf277e5bc70d4064ebc05691bd62b0b'
             'SKIP'
-            '940dc96b64919b7dbf32c37e0e1d1fc88cc18e1d4b3acf1e7dfe5a46eb6523a9'
+            'f4d7505bc111044eaa4033af012221e492938405b62522b8e3e354c20c4b71e9'
             'SKIP'
-            '7e62bd5dd1ae5755a63abab692ae366186be392104e232e6b3a10a4ea5807283'
-            '0e45ad131908a121f628d1575d32b7ad522b3a7039b517dfef4aac25243f3e7f'
             '312574e655f9a87784ca416949c505c452b819fad3061f2cde8aced6540a19a3'
             '597dc5968c695bbdbb0eac9e8eb5117fcd2773bc91edf5ec103ecffffab8bc48')
-validpgpkeys=('11E521D646982372EB577A1F8F0871F202119294')
+validpgpkeys=('11E521D646982372EB577A1F8F0871F202119294'
+              'B6C8F98282B944E3B0D5C2530FC3042E345AD05D')
 
 prepare() {
   cd "$srcdir/llvm-$pkgver.src"
@@ -64,25 +61,17 @@
   sed -i 's:$(PROJ_prefix)/docs/llvm:$(PROJ_prefix)/share/doc/llvm:' \
     Makefile.config.in
 
-  # Fix definition of LLVM_CMAKE_DIR in LLVMConfig.cmake
-  sed -i '/@LLVM_CONFIG_CMAKE_DIR@/s:$(PROJ_cmake):$(PROJ_prefix)/share/llvm/cmake:' \
-    cmake/modules/Makefile
-
   # Use Python 2
   find tools/lldb -name Makefile -exec sed -i 's/python-config/python2-config/' {} +
-  sed -i 's|/usr/bin/env python|&2|' \
-    tools/lldb/scripts/Python/{build-swig-Python,finish-swig-Python-LLDB}.sh
+  sed -i -e 's|env python|&2|' -e 's|/usr/bin/python$|&2|' \
+    tools/lldb/scripts/Python/{build-swig-Python,finish-swig-Python-LLDB}.sh \
+    tools/lldb/examples/python/symbolication.py
 
-  # Fix docs/Makefile to use ocamlfind
-  # http://llvm.org/bugs/show_bug.cgi?id=22737
-  patch -Np1 -i ../llvm-3.6.0-use-ocamlfind-for-ocamldoc.patch
-
-  # Fix build with ocaml-ctypes 0.4.x
-  patch -Np1 -i ../llvm-ocaml-ctypes-0.4.patch
+  mkdir build
 }
 
 build() {
-  cd "$srcdir/llvm-$pkgver.src"
+  cd "$srcdir/llvm-$pkgver.src/build"
 
   # Include location of libffi headers in CPPFLAGS
   CPPFLAGS+=" $(pkg-config --cflags libffi)"
@@ -89,7 +78,7 @@
 
   # Force the use of GCC instead of clang
   CC=gcc CXX=g++ \
-  ./configure \
+  ../configure \
     --prefix=/usr \
     --sysconfdir=/etc \
     --enable-shared \
@@ -102,9 +91,10 @@
     --with-python=/usr/bin/python2
 
   make REQUIRES_RTTI=1
-  make -C docs -f Makefile.sphinx man
-  make -C docs -f Makefile.sphinx html
-  make -C tools/clang/docs -f Makefile.sphinx html
+  make -C ../docs -f Makefile.sphinx man
+  make -C ../docs -f Makefile.sphinx html
+  make -C ../tools/clang/docs -f Makefile.sphinx man
+  make -C ../tools/clang/docs -f Makefile.sphinx html
 }
 
 package_llvm() {
@@ -113,17 +103,19 @@
 
   cd "$srcdir/llvm-$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/"
+  # Temporarily rename clang and lldb directories so they don't get installed
+  for tool in clang lldb; do
+      mv build/tools/$tool{,.hidden}
+      mv tools/$tool{,.hidden}
+  done
 
-  # Same for lldb
-  mv tools/lldb "$srcdir/"
+  make -C build DESTDIR="$pkgdir" install
 
-  # -j1 is due to race conditions during the installation of the OCaml bindings
-  make -j1 DESTDIR="$pkgdir" install
-  mv "$srcdir/clang" tools
-  mv "$srcdir/lldb" tools
+  # Restore original tool directory names
+  for tool in clang lldb; do
+      mv build/tools/$tool{.hidden,}
+      mv tools/$tool{.hidden,}
+  done
 
   # The runtime libraries go into llvm-libs
   mv -f "$pkgdir/usr/lib/libLLVM-$pkgver.so" "$srcdir/"
@@ -202,9 +194,9 @@
   url="http://lldb.llvm.org/"
   depends=("llvm-libs=$pkgver-$pkgrel" 'libedit' 'python2')
 
-  cd "$srcdir/llvm-$pkgver.src/tools/lldb"
+  cd "$srcdir/llvm-$pkgver.src"
 
-  make DESTDIR="$pkgdir" install
+  make -C build/tools/lldb DESTDIR="$pkgdir" install
 
   # Fix permissions of static libs
   chmod -x "$pkgdir"/usr/lib/*.a
@@ -216,7 +208,7 @@
   python2 -m compileall "$pkgdir/usr/lib/python2.7/site-packages/lldb"
   python2 -O -m compileall "$pkgdir/usr/lib/python2.7/site-packages/lldb"
 
-  install -Dm644 LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+  install -Dm644 tools/lldb/LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
 }
 
 package_clang() {
@@ -224,18 +216,21 @@
   url="http://clang.llvm.org/"
   depends=("llvm-libs=$pkgver-$pkgrel" 'gcc')
 
+  cd "$srcdir/llvm-$pkgver.src"
+
   # Fix installation path for clang docs
   sed -i 's:$(PROJ_prefix)/share/doc/llvm:$(PROJ_prefix)/share/doc/clang:' \
-    "$srcdir/llvm-$pkgver.src/Makefile.config"
+    build/Makefile.config
 
-  cd "$srcdir/llvm-$pkgver.src/tools/clang"
+  # Temporarily rename clang extra tools directory so they don't get installed
+  mv build/tools/clang/tools/extra{,.hidden}
+  mv tools/clang/tools/extra{,.hidden}
 
-  # We move the extra tools directory out of the tree so it won't get
-  # installed and then we bring it back in for the clang-tools-extra package
-  mv tools/extra "$srcdir"
+  make -C build/tools/clang DESTDIR="$pkgdir" install
 
-  make DESTDIR="$pkgdir" install
-  mv "$srcdir/extra" tools/
+  # Restore original extra tools directory name
+  mv build/tools/clang/tools/extra{.hidden,}
+  mv tools/clang/tools/extra{.hidden,}
 
   # Fix permissions of static libs
   chmod -x "$pkgdir"/usr/lib/*.a
@@ -242,15 +237,19 @@
 
   # 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.src/Makefile.config"
+    build/Makefile.config
 
+  # Install man pages
+  install -d "$pkgdir/usr/share/man/man1"
+  cp tools/clang/docs/_build/man/*.1 "$pkgdir/usr/share/man/man1/"
+
   # Install html docs
-  cp -r docs/_build/html/* "$pkgdir/usr/share/doc/$pkgname/html/"
+  cp -r tools/clang/docs/_build/html/* "$pkgdir/usr/share/doc/$pkgname/html/"
   rm -r "$pkgdir/usr/share/doc/$pkgname/html/_sources"
 
   # Install Python bindings
   install -d "$pkgdir/usr/lib/python2.7/site-packages"
-  cp -r bindings/python/clang "$pkgdir/usr/lib/python2.7/site-packages/"
+  cp -r tools/clang/bindings/python/clang "$pkgdir/usr/lib/python2.7/site-packages/"
   python2 -m compileall "$pkgdir/usr/lib/python2.7/site-packages/clang"
   python2 -O -m compileall "$pkgdir/usr/lib/python2.7/site-packages/clang"
 
@@ -258,7 +257,7 @@
   # Destination paths are copied from clang-format/CMakeLists.txt
   install -d "$pkgdir/usr/share/$pkgname"
   (
-    cd tools/clang-format
+    cd tools/clang/tools/clang-format
     cp \
       clang-format-diff.py \
       clang-format-sublime.py \
@@ -271,7 +270,8 @@
       "$pkgdir/usr/share/$pkgname/clang-format-diff.py"
   )
 
-  install -Dm644 LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+  install -Dm644 tools/clang/LICENSE.TXT \
+    "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
 }
 
 package_clang-analyzer() {
@@ -296,9 +296,7 @@
     "$pkgdir/usr/share/man/man1/"
 
   # Use Python 2
-  sed -i \
-    -e 's|env python$|&2|' \
-    -e 's|/usr/bin/python$|&2|' \
+  sed -i -e 's|env python$|&2|' -e 's|/usr/bin/python$|&2|' \
     "$pkgdir/usr/lib/clang-analyzer/scan-view/scan-view" \
     "$pkgdir/usr/lib/clang-analyzer/scan-build/set-xcode-analyzer"
 
@@ -314,14 +312,15 @@
   url="http://clang.llvm.org/"
   depends=("clang=$pkgver-$pkgrel")
 
-  cd "$srcdir/llvm-$pkgver.src/tools/clang/tools/extra"
+  cd "$srcdir/llvm-$pkgver.src"
 
-  make DESTDIR="$pkgdir" install
+  make -C build/tools/clang/tools/extra DESTDIR="$pkgdir" install
 
   # Fix permissions of static libs
   chmod -x "$pkgdir"/usr/lib/*.a
 
-  install -Dm644 LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+  install -Dm644 tools/clang/tools/extra/LICENSE.TXT \
+    "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
 }
 
 # vim:set ts=2 sw=2 et:

Deleted: llvm-3.6.0-use-ocamlfind-for-ocamldoc.patch
===================================================================
--- llvm-3.6.0-use-ocamlfind-for-ocamldoc.patch	2015-09-16 08:57:08 UTC (rev 246401)
+++ llvm-3.6.0-use-ocamlfind-for-ocamldoc.patch	2015-09-16 11:29:38 UTC (rev 246402)
@@ -1,30 +0,0 @@
-diff -upr llvm-3.6.0.src.orig/docs/Makefile llvm-3.6.0.src/docs/Makefile
---- llvm-3.6.0.src.orig/docs/Makefile	2014-10-29 00:45:25.000000000 +0200
-+++ llvm-3.6.0.src/docs/Makefile	2015-02-28 10:12:35.647351241 +0200
-@@ -41,7 +41,7 @@ install_targets := install-html
- ifeq ($(ENABLE_DOXYGEN),1)
- install_targets += install-doxygen
- endif
--ifdef OCAMLDOC
-+ifdef OCAMLFIND
- ifneq (,$(filter ocaml,$(BINDINGS_TO_BUILD)))
- install_targets += install-ocamldoc
- endif
-@@ -49,7 +49,7 @@ endif
- install-local:: $(install_targets)
- 
- generated_targets := doxygen
--ifdef OCAMLDOC
-+ifdef OCAMLFIND
- generated_targets += ocamldoc
- endif
- 
-@@ -120,7 +120,7 @@ regen-ocamldoc:
- 	$(Verb) $(MAKE) -C $(LEVEL)/bindings/ocaml ocamldoc
- 	$(Verb) $(MKDIR) $(PROJ_OBJ_DIR)/ocamldoc/html
- 	$(Verb) \
--		$(OCAMLDOC) -d $(PROJ_OBJ_DIR)/ocamldoc/html -sort -colorize-code -html \
-+		$(OCAMLFIND) ocamldoc -d $(PROJ_OBJ_DIR)/ocamldoc/html -sort -colorize-code -html \
- 		`$(FIND) $(LEVEL)/bindings/ocaml -name "*.odoc" \
- 		         -path "*/$(BuildMode)/*.odoc" -exec echo -load '{}' ';'`
- 

Deleted: llvm-ocaml-ctypes-0.4.patch
===================================================================
--- llvm-ocaml-ctypes-0.4.patch	2015-09-16 08:57:08 UTC (rev 246401)
+++ llvm-ocaml-ctypes-0.4.patch	2015-09-16 11:29:38 UTC (rev 246402)
@@ -1,75 +0,0 @@
-From b9fec3eb617427a77d2b73fd962e90bb4b5d734f Mon Sep 17 00:00:00 2001
-From: Peter Zotov <whitequark at whitequark.org>
-Date: Sat, 27 Jun 2015 14:32:30 +0000
-Subject: [PATCH] [OCaml] Bump ctypes dependency to 0.4.
-
-ctypes 0.3 and earlier contains an interface-definig bug:
-its ptr_of_raw_address accepts Int64 and not Nativeint. ctypes 0.4
-was not released during the 3.6 cycle, and because of that, LLVM 3.6
-was released with ctypes 0.3 as a dependency, which now breaks
-the build on modern ctypes.
-
-Unbreak.
-
-git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240882 91177308-0d34-0410-b5e6-96231b3b80d8
----
- bindings/ocaml/executionengine/llvm_executionengine.ml | 10 +++++-----
- cmake/config-ix.cmake                                  |  4 ++--
- 2 files changed, 7 insertions(+), 7 deletions(-)
-
-diff --git a/bindings/ocaml/executionengine/llvm_executionengine.ml b/bindings/ocaml/executionengine/llvm_executionengine.ml
-index 34031be..3f37e0c 100644
---- a/bindings/ocaml/executionengine/llvm_executionengine.ml
-+++ b/bindings/ocaml/executionengine/llvm_executionengine.ml
-@@ -43,11 +43,11 @@ external run_static_dtors : llexecutionengine -> unit
-   = "llvm_ee_run_static_dtors"
- external data_layout : llexecutionengine -> Llvm_target.DataLayout.t
-   = "llvm_ee_get_data_layout"
--external add_global_mapping_ : Llvm.llvalue -> int64 -> llexecutionengine -> unit
-+external add_global_mapping_ : Llvm.llvalue -> nativeint -> llexecutionengine -> unit
-   = "llvm_ee_add_global_mapping"
--external get_global_value_address_ : string -> llexecutionengine -> int64
-+external get_global_value_address_ : string -> llexecutionengine -> nativeint
-   = "llvm_ee_get_global_value_address"
--external get_function_address_ : string -> llexecutionengine -> int64
-+external get_function_address_ : string -> llexecutionengine -> nativeint
-   = "llvm_ee_get_function_address"
- 
- let add_global_mapping llval ptr ee =
-@@ -55,14 +55,14 @@ let add_global_mapping llval ptr ee =
- 
- let get_global_value_address name typ ee =
-   let vptr = get_global_value_address_ name ee in
--  if Int64.to_int vptr <> 0 then
-+  if Nativeint.to_int vptr <> 0 then
-     let open Ctypes in !@ (coerce (ptr void) (ptr typ) (ptr_of_raw_address vptr))
-   else
-     raise (Error ("Value " ^ name ^ " not found"))
- 
- let get_function_address name typ ee =
-   let fptr = get_function_address_ name ee in
--  if Int64.to_int fptr <> 0 then
-+  if Nativeint.to_int fptr <> 0 then
-     let open Ctypes in coerce (ptr void) typ (ptr_of_raw_address fptr)
-   else
-     raise (Error ("Function " ^ name ^ " not found"))
-diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
-index 4e22aab..f0855d6 100755
---- a/cmake/config-ix.cmake
-+++ b/cmake/config-ix.cmake
-@@ -546,13 +546,13 @@ else()
-     if( OCAML_VERSION VERSION_LESS "4.00.0" )
-       message(STATUS "OCaml bindings disabled, need OCaml >=4.00.0.")
-     else()
--      find_ocamlfind_package(ctypes VERSION 0.3 OPTIONAL)
-+      find_ocamlfind_package(ctypes VERSION 0.4 OPTIONAL)
-       if( HAVE_OCAML_CTYPES )
-         message(STATUS "OCaml bindings enabled.")
-         find_ocamlfind_package(oUnit VERSION 2 OPTIONAL)
-         set(LLVM_BINDINGS "${LLVM_BINDINGS} ocaml")
-       else()
--        message(STATUS "OCaml bindings disabled, need ctypes >=0.3.")
-+        message(STATUS "OCaml bindings disabled, need ctypes >=0.4.")
-       endif()
-     endif()
-   endif()



More information about the arch-commits mailing list