[arch-commits] Commit in llvm/repos (6 files)
Evangelos Foutras
foutrelis at archlinux.org
Tue Aug 7 23:35:54 UTC 2018
Date: Tuesday, August 7, 2018 @ 23:35:54
Author: foutrelis
Revision: 331142
archrelease: copy trunk to testing-x86_64
Added:
llvm/repos/testing-x86_64/
llvm/repos/testing-x86_64/D44391-export-LLVM_DYLIB_COMPONENTS-in-LLVMConfig.cmake.patch
(from rev 331141, llvm/trunk/D44391-export-LLVM_DYLIB_COMPONENTS-in-LLVMConfig.cmake.patch)
llvm/repos/testing-x86_64/D44420-cmake-fix-a-typo-in-llvm_config-macro.patch
(from rev 331141, llvm/trunk/D44420-cmake-fix-a-typo-in-llvm_config-macro.patch)
llvm/repos/testing-x86_64/D50416-cmake-Prevent-LLVMgold.so-from-being-unloaded-on-Lin.patch
(from rev 331141, llvm/trunk/D50416-cmake-Prevent-LLVMgold.so-from-being-unloaded-on-Lin.patch)
llvm/repos/testing-x86_64/PKGBUILD
(from rev 331141, llvm/trunk/PKGBUILD)
llvm/repos/testing-x86_64/llvm-config.h
(from rev 331141, llvm/trunk/llvm-config.h)
-------------------------------------------------------------------+
D44391-export-LLVM_DYLIB_COMPONENTS-in-LLVMConfig.cmake.patch | 36 ++
D44420-cmake-fix-a-typo-in-llvm_config-macro.patch | 13
D50416-cmake-Prevent-LLVMgold.so-from-being-unloaded-on-Lin.patch | 28 ++
PKGBUILD | 138 ++++++++++
llvm-config.h | 9
5 files changed, 224 insertions(+)
Copied: llvm/repos/testing-x86_64/D44391-export-LLVM_DYLIB_COMPONENTS-in-LLVMConfig.cmake.patch (from rev 331141, llvm/trunk/D44391-export-LLVM_DYLIB_COMPONENTS-in-LLVMConfig.cmake.patch)
===================================================================
--- testing-x86_64/D44391-export-LLVM_DYLIB_COMPONENTS-in-LLVMConfig.cmake.patch (rev 0)
+++ testing-x86_64/D44391-export-LLVM_DYLIB_COMPONENTS-in-LLVMConfig.cmake.patch 2018-08-07 23:35:54 UTC (rev 331142)
@@ -0,0 +1,36 @@
+From 4d613a84ce271c6225068bef67d727ae02b2e3b1 Mon Sep 17 00:00:00 2001
+From: Pavel Labath <labath at google.com>
+Date: Wed, 14 Mar 2018 09:28:38 +0000
+Subject: [PATCH] Export LLVM_DYLIB_COMPONENTS in LLVMConfig.cmake
+
+Summary:
+This is needed so that external projects (e.g. a standalone build of
+lldb) can link to the LLVM shared library via the USE_SHARED argument of
+llvm_config. Without this, llvm_config would add LLVM to the link list,
+but then also add the constituent static libraries, resulting in
+multiply defined symbols.
+
+Reviewers: beanz, mgorny
+
+Subscribers: llvm-commits
+
+Differential Revision: https://reviews.llvm.org/D44391
+
+git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327484 91177308-0d34-0410-b5e6-96231b3b80d8
+---
+ cmake/modules/LLVMConfig.cmake.in | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/cmake/modules/LLVMConfig.cmake.in b/cmake/modules/LLVMConfig.cmake.in
+index fe4df5278498..e70018679846 100644
+--- a/cmake/modules/LLVMConfig.cmake.in
++++ b/cmake/modules/LLVMConfig.cmake.in
+@@ -13,6 +13,8 @@ set(LLVM_COMMON_DEPENDS @LLVM_COMMON_DEPENDS@)
+
+ set(LLVM_AVAILABLE_LIBS @LLVM_AVAILABLE_LIBS@)
+
++set(LLVM_DYLIB_COMPONENTS @LLVM_DYLIB_COMPONENTS@)
++
+ set(LLVM_ALL_TARGETS @LLVM_ALL_TARGETS@)
+
+ set(LLVM_TARGETS_TO_BUILD @LLVM_TARGETS_TO_BUILD@)
Copied: llvm/repos/testing-x86_64/D44420-cmake-fix-a-typo-in-llvm_config-macro.patch (from rev 331141, llvm/trunk/D44420-cmake-fix-a-typo-in-llvm_config-macro.patch)
===================================================================
--- testing-x86_64/D44420-cmake-fix-a-typo-in-llvm_config-macro.patch (rev 0)
+++ testing-x86_64/D44420-cmake-fix-a-typo-in-llvm_config-macro.patch 2018-08-07 23:35:54 UTC (rev 331142)
@@ -0,0 +1,13 @@
+Index: cmake/modules/LLVM-Config.cmake
+===================================================================
+--- cmake/modules/LLVM-Config.cmake
++++ cmake/modules/LLVM-Config.cmake
+@@ -68,7 +68,7 @@
+ cmake_parse_arguments(ARG "USE_SHARED" "" "" ${ARGN})
+ set(link_components ${ARG_UNPARSED_ARGUMENTS})
+
+- if(USE_SHARED)
++ if(ARG_USE_SHARED)
+ # If USE_SHARED is specified, then we link against libLLVM,
+ # but also against the component libraries below. This is
+ # done in case libLLVM does not contain all of the components
Copied: llvm/repos/testing-x86_64/D50416-cmake-Prevent-LLVMgold.so-from-being-unloaded-on-Lin.patch (from rev 331141, llvm/trunk/D50416-cmake-Prevent-LLVMgold.so-from-being-unloaded-on-Lin.patch)
===================================================================
--- testing-x86_64/D50416-cmake-Prevent-LLVMgold.so-from-being-unloaded-on-Lin.patch (rev 0)
+++ testing-x86_64/D50416-cmake-Prevent-LLVMgold.so-from-being-unloaded-on-Lin.patch 2018-08-07 23:35:54 UTC (rev 331142)
@@ -0,0 +1,28 @@
+From 4961e6f4874713052bc0b777742268b89929a356 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos at foutrelis.com>
+Date: Wed, 8 Aug 2018 01:40:26 +0300
+Subject: [PATCH] [cmake] Prevent LLVMgold.so from being unloaded on Linux
+
+Extend the fix from D40459 to also apply to modules such as the LLVM
+gold plugin. This is needed because current binutils master (and future
+binutils 2.32) calls dlclose() on bfd plugins as part of a recent fix
+for PR23460 (https://sourceware.org/bugzilla/show_bug.cgi?id=23460).
+---
+ cmake/modules/HandleLLVMOptions.cmake | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
+index 5fd318f0..05cf9026 100644
+--- a/cmake/modules/HandleLLVMOptions.cmake
++++ b/cmake/modules/HandleLLVMOptions.cmake
+@@ -149,6 +149,7 @@ endif()
+ # is unloaded.
+ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,nodelete")
++ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-z,nodelete")
+ endif()
+
+
+--
+2.18.0
+
Copied: llvm/repos/testing-x86_64/PKGBUILD (from rev 331141, llvm/trunk/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD (rev 0)
+++ testing-x86_64/PKGBUILD 2018-08-07 23:35:54 UTC (rev 331142)
@@ -0,0 +1,138 @@
+# $Id$
+# Maintainer: Evangelos Foutras <evangelos at foutrelis.com>
+# Contributor: Jan "heftig" Steffens <jan.steffens at gmail.com>
+
+pkgname=('llvm' 'llvm-libs' 'llvm-ocaml')
+pkgver=6.0.1
+pkgrel=3
+_ocaml_ver=4.06.0
+arch=('x86_64')
+url="https://llvm.org/"
+license=('custom:University of Illinois/NCSA Open Source License')
+makedepends=('cmake' 'ninja' 'libffi' 'libedit' 'ncurses' 'libxml2' 'python-sphinx'
+ "ocaml=$_ocaml_ver" 'ocaml-ctypes' 'ocaml-findlib')
+options=('staticlibs')
+source=(https://releases.llvm.org/$pkgver/llvm-$pkgver.src.tar.xz{,.sig}
+ D44391-export-LLVM_DYLIB_COMPONENTS-in-LLVMConfig.cmake.patch
+ D44420-cmake-fix-a-typo-in-llvm_config-macro.patch
+ D50416-cmake-Prevent-LLVMgold.so-from-being-unloaded-on-Lin.patch
+ llvm-config.h)
+sha256sums=('b6d6c324f9c71494c0ccaf3dac1f16236d970002b42bb24a6c9e1634f7d0f4e2'
+ 'SKIP'
+ '96e2f3ca8b7d1bdbe2606a1eebb12c57b39838d1bcc15e40388e8d59649a9f4a'
+ '5cc114fd711e6ea836a6270b2f713e2e751c49e8b5ffa6c6812127ca801acef3'
+ '4be3c981e1eac0e3d9cbfd98f2763ff8f72f7636d1cb8dca599c8c5d824d1fbb'
+ '597dc5968c695bbdbb0eac9e8eb5117fcd2773bc91edf5ec103ecffffab8bc48')
+validpgpkeys+=('B6C8F98282B944E3B0D5C2530FC3042E345AD05D') # Hans Wennborg <hans at chromium.org>
+validpgpkeys+=('474E22316ABF4785A88C6E8EA2C794A986419D8A') # Tom Stellard <tstellar at redhat.com>
+
+prepare() {
+ cd "$srcdir/llvm-$pkgver.src"
+ mkdir build
+
+ # https://reviews.llvm.org/D44391
+ patch -Np1 -i ../D44391-export-LLVM_DYLIB_COMPONENTS-in-LLVMConfig.cmake.patch
+
+ # https://reviews.llvm.org/D44420
+ patch -Np0 -i ../D44420-cmake-fix-a-typo-in-llvm_config-macro.patch
+
+ # https://reviews.llvm.org/D50416
+ # https://sourceware.org/bugzilla/show_bug.cgi?id=23460#c10
+ patch -Np1 -i ../D50416-cmake-Prevent-LLVMgold.so-from-being-unloaded-on-Lin.patch
+}
+
+build() {
+ cd "$srcdir/llvm-$pkgver.src/build"
+
+ cmake .. -G Ninja \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DLLVM_HOST_TRIPLE=$CHOST \
+ -DLLVM_BUILD_LLVM_DYLIB=ON \
+ -DLLVM_LINK_LLVM_DYLIB=ON \
+ -DLLVM_INSTALL_UTILS=ON \
+ -DLLVM_ENABLE_RTTI=ON \
+ -DLLVM_ENABLE_FFI=ON \
+ -DLLVM_BUILD_TESTS=ON \
+ -DLLVM_BUILD_DOCS=ON \
+ -DLLVM_ENABLE_SPHINX=ON \
+ -DLLVM_ENABLE_DOXYGEN=OFF \
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF \
+ -DFFI_INCLUDE_DIR=$(pkg-config --variable=includedir libffi) \
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ ninja all ocaml_doc
+}
+
+check() {
+ cd "$srcdir/llvm-$pkgver.src/build"
+ ninja check
+}
+
+package_llvm() {
+ pkgdesc="Collection of modular and reusable compiler and toolchain technologies"
+ depends=('llvm-libs' 'perl')
+ optdepends=('python-setuptools: for using lit (LLVM Integrated Tester)')
+
+ cd "$srcdir/llvm-$pkgver.src/build"
+
+ DESTDIR="$pkgdir" ninja install
+
+ # Include lit for running tests with clang and friends
+ pushd ../utils/lit
+ python3 setup.py install --root="$pkgdir" -O1
+ popd
+
+ # Remove documentation sources
+ rm -r "$pkgdir"/usr/share/doc/$pkgname/html/{_sources,.buildinfo}
+
+ # The runtime libraries go into llvm-libs
+ mv -f "$pkgdir"/usr/lib/lib{LLVM,LTO}*.so* "$srcdir"
+ mv -f "$pkgdir"/usr/lib/LLVMgold.so "$srcdir"
+
+ # OCaml bindings go to a separate package
+ rm -rf "$srcdir"/ocaml.{lib,doc}
+ mv "$pkgdir/usr/lib/ocaml" "$srcdir/ocaml.lib"
+ mv "$pkgdir/usr/share/doc/$pkgname/ocaml-html" "$srcdir/ocaml.doc"
+
+ if [[ $CARCH == x86_64 ]]; then
+ # Needed for multilib (https://bugs.archlinux.org/task/29951)
+ # Header stub is taken from Fedora
+ mv "$pkgdir/usr/include/llvm/Config/llvm-config"{,-64}.h
+ cp "$srcdir/llvm-config.h" "$pkgdir/usr/include/llvm/Config/llvm-config.h"
+ fi
+
+ install -Dm644 ../LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
+
+package_llvm-libs() {
+ pkgdesc="LLVM runtime libraries"
+ depends=('gcc-libs' 'zlib' 'libffi' 'libedit' 'ncurses' 'libxml2')
+
+ install -d "$pkgdir/usr/lib"
+ cp -P \
+ "$srcdir"/lib{LLVM,LTO}*.so* \
+ "$srcdir"/LLVMgold.so \
+ "$pkgdir/usr/lib/"
+
+ # Symlink LLVMgold.so from /usr/lib/bfd-plugins
+ # https://bugs.archlinux.org/task/28479
+ install -d "$pkgdir/usr/lib/bfd-plugins"
+ ln -s ../LLVMgold.so "$pkgdir/usr/lib/bfd-plugins/LLVMgold.so"
+
+ install -Dm644 "$srcdir/llvm-$pkgver.src/LICENSE.TXT" \
+ "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
+
+package_llvm-ocaml() {
+ pkgdesc="OCaml bindings for LLVM"
+ depends=('llvm' "ocaml=$_ocaml_ver" 'ocaml-ctypes')
+
+ install -d "$pkgdir"/{usr/lib,usr/share/doc/$pkgname}
+ cp -a "$srcdir/ocaml.lib" "$pkgdir/usr/lib/ocaml"
+ cp -a "$srcdir/ocaml.doc" "$pkgdir/usr/share/doc/$pkgname/html"
+
+ install -Dm644 "$srcdir/llvm-$pkgver.src/LICENSE.TXT" \
+ "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
+
+# vim:set ts=2 sw=2 et:
Copied: llvm/repos/testing-x86_64/llvm-config.h (from rev 331141, llvm/trunk/llvm-config.h)
===================================================================
--- testing-x86_64/llvm-config.h (rev 0)
+++ testing-x86_64/llvm-config.h 2018-08-07 23:35:54 UTC (rev 331142)
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
More information about the arch-commits
mailing list