[arch-commits] Commit in llvm7/repos (4 files)

Evangelos Foutras foutrelis at archlinux.org
Wed Apr 8 23:58:49 UTC 2020


    Date: Wednesday, April 8, 2020 @ 23:58:48
  Author: foutrelis
Revision: 379880

archrelease: copy trunk to staging-x86_64

Added:
  llvm7/repos/staging-x86_64/
  llvm7/repos/staging-x86_64/PKGBUILD
    (from rev 379879, llvm7/trunk/PKGBUILD)
  llvm7/repos/staging-x86_64/add-discriminator-to-debuginfo-test.patch
    (from rev 379879, llvm7/trunk/add-discriminator-to-debuginfo-test.patch)
  llvm7/repos/staging-x86_64/rusty-discriminator-thingy.patch
    (from rev 379879, llvm7/trunk/rusty-discriminator-thingy.patch)

-------------------------------------------+
 PKGBUILD                                  |   97 ++++++++++++++++++++++++++++
 add-discriminator-to-debuginfo-test.patch |   25 +++++++
 rusty-discriminator-thingy.patch          |   57 ++++++++++++++++
 3 files changed, 179 insertions(+)

Copied: llvm7/repos/staging-x86_64/PKGBUILD (from rev 379879, llvm7/trunk/PKGBUILD)
===================================================================
--- staging-x86_64/PKGBUILD	                        (rev 0)
+++ staging-x86_64/PKGBUILD	2020-04-08 23:58:48 UTC (rev 379880)
@@ -0,0 +1,97 @@
+# Maintainer: Evangelos Foutras <evangelos at foutrelis.com>
+# Contributor: Jan "heftig" Steffens <jan.steffens at gmail.com>
+
+# ************************************************************************** #
+# This package is meant to be used for compiling packages that have not been #
+# ported to LLVM 8 yet. Such packages may depend on llvm7-libs but not llvm7 #
+# which is not co-installable with the main llvm package (currently LLVM 8). #
+# ************************************************************************** #
+
+pkgname=('llvm7' 'llvm7-libs')
+pkgver=7.1.0
+pkgrel=3
+arch=('x86_64')
+url="https://llvm.org/"
+license=('custom:University of Illinois/NCSA Open Source License')
+makedepends=('cmake' 'ninja' 'libffi' 'libedit' 'ncurses' 'libxml2'
+             'python-setuptools')
+options=('staticlibs')
+source=(https://releases.llvm.org/$pkgver/llvm-$pkgver.src.tar.xz{,.sig}
+        rusty-discriminator-thingy.patch
+        add-discriminator-to-debuginfo-test.patch)
+sha256sums=('1bcc9b285074ded87b88faaedddb88e6b5d6c331dfcfb57d7f3393dd622b3764'
+            'SKIP'
+            '4abaef845abb899628deb62a3f184fb8433555620648150dc346a74ef134fd68'
+            '1d2ea3a07e94f4c826706a452e93ed8a2301b5eed5715d22eab19a5ea3f3d0a7')
+validpgpkeys+=('B6C8F98282B944E3B0D5C2530FC3042E345AD05D') # Hans Wennborg <hans at chromium.org>
+validpgpkeys+=('474E22316ABF4785A88C6E8EA2C794A986419D8A') # Tom Stellard <tstellar at redhat.com>
+
+prepare() {
+  cd "$srcdir/llvm-$pkgver.src"
+  mkdir build
+
+  # Fix rust 1.32 segfaults with LTO being enabled
+  # https://github.com/rust-lang/rust/issues/54614
+  patch -Np1 -i ../rusty-discriminator-thingy.patch
+  patch -Np1 -i ../add-discriminator-to-debuginfo-test.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 \
+    -DFFI_INCLUDE_DIR=$(pkg-config --variable=includedir libffi) \
+    -DLLVM_BINUTILS_INCDIR=/usr/include
+  ninja
+}
+
+check() {
+  cd "$srcdir/llvm-$pkgver.src/build"
+  ninja check
+}
+
+package_llvm7() {
+  pkgdesc="Collection of modular and reusable compiler and toolchain technologies"
+  depends=('llvm7-libs' 'perl')
+  optdepends=('python-setuptools: for using lit (LLVM Integrated Tester)')
+  conflicts=('llvm')
+
+  cd "$srcdir/llvm-$pkgver.src/build"
+
+  DESTDIR="$pkgdir" ninja install
+
+  # Include lit for running lit-based tests in other projects
+  pushd ../utils/lit
+  python3 setup.py install --root="$pkgdir" -O1
+  popd
+
+  # The runtime libraries go into llvm7-libs
+  mv -f "$pkgdir"/usr/lib/lib{LLVM-*.so,LTO.so.*} "$srcdir"
+
+  # Remove files which conflict with llvm-libs
+  rm "$pkgdir"/usr/lib/{LLVMgold,lib{LLVM,LTO}}.so
+
+  install -Dm644 ../LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
+
+package_llvm7-libs() {
+  pkgdesc="LLVM 7 runtime libraries"
+  depends=('gcc-libs' 'zlib' 'libffi' 'libedit' 'ncurses' 'libxml2')
+
+  install -d "$pkgdir/usr/lib"
+  cp -P "$srcdir"/lib{LLVM-*.so,LTO.so.*} "$pkgdir/usr/lib/"
+
+  install -Dm644 "$srcdir/llvm-$pkgver.src/LICENSE.TXT" \
+    "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
+
+# vim:set ts=2 sw=2 et:

Copied: llvm7/repos/staging-x86_64/add-discriminator-to-debuginfo-test.patch (from rev 379879, llvm7/trunk/add-discriminator-to-debuginfo-test.patch)
===================================================================
--- staging-x86_64/add-discriminator-to-debuginfo-test.patch	                        (rev 0)
+++ staging-x86_64/add-discriminator-to-debuginfo-test.patch	2020-04-08 23:58:48 UTC (rev 379880)
@@ -0,0 +1,25 @@
+From cc1f2a595ead516812a6c50398f0f3480ebe031f Mon Sep 17 00:00:00 2001
+From: Jonas Devlieghere <jonas at devlieghere.com>
+Date: Fri, 21 Sep 2018 12:28:44 +0000
+Subject: [PATCH] [test] Fix Assembler/debug-info.ll
+
+Update Assembler/debug-info.ll to contain discriminator.
+
+git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342727 91177308-0d34-0410-b5e6-96231b3b80d8
+---
+ test/Assembler/debug-info.ll | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/Assembler/debug-info.ll b/test/Assembler/debug-info.ll
+index 4404b741d343..d54dba07ac1e 100644
+--- a/test/Assembler/debug-info.ll
++++ b/test/Assembler/debug-info.ll
+@@ -83,7 +83,7 @@
+ ; CHECK-NEXT: !32 = !DIFile(filename: "file", directory: "dir", checksumkind: CSK_MD5, checksum: "000102030405060708090a0b0c0d0e0f")
+ !35 = !DIFile(filename: "file", directory: "dir", checksumkind: CSK_MD5, checksum: "000102030405060708090a0b0c0d0e0f")
+ 
+-; CHECK-NEXT: !33 = !DICompositeType(tag: DW_TAG_variant_part, name: "A", scope: !14, size: 64)
++; CHECK-NEXT: !33 = !DICompositeType(tag: DW_TAG_variant_part, name: "A", scope: !14, size: 64, discriminator: !34)
+ ; CHECK-NEXT: !34 = !DIDerivedType(tag: DW_TAG_member, scope: !33, baseType: !35, size: 64, align: 64, flags: DIFlagArtificial)
+ ; CHECK-NEXT: !35 = !DIBasicType(name: "u64", size: 64, encoding: DW_ATE_unsigned)
+ !36 = !DICompositeType(tag: DW_TAG_variant_part, name: "A", scope: !16, size: 64, discriminator: !37)

Copied: llvm7/repos/staging-x86_64/rusty-discriminator-thingy.patch (from rev 379879, llvm7/trunk/rusty-discriminator-thingy.patch)
===================================================================
--- staging-x86_64/rusty-discriminator-thingy.patch	                        (rev 0)
+++ staging-x86_64/rusty-discriminator-thingy.patch	2020-04-08 23:58:48 UTC (rev 379880)
@@ -0,0 +1,57 @@
+From da1fb72bb305d6bc1f3899d541414146934bf80f Mon Sep 17 00:00:00 2001
+From: Jonas Devlieghere <jonas at devlieghere.com>
+Date: Fri, 21 Sep 2018 12:03:14 +0000
+Subject: [PATCH] Ensure that variant part discriminator is read by
+ MetadataLoader
+
+https://reviews.llvm.org/D42082 introduced variant parts to debug info
+in LLVM. Subsequent work on the Rust compiler has found a bug in that
+patch; namely, there is a path in MetadataLoader that fails to restore
+the discriminator.
+
+This patch fixes the bug.
+
+Patch by: Tom Tromey
+
+Differential revision: https://reviews.llvm.org/D52340
+
+git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342725 91177308-0d34-0410-b5e6-96231b3b80d8
+---
+ lib/Bitcode/Reader/MetadataLoader.cpp         |  2 +-
+ test/Assembler/debug-variant-discriminator.ll | 14 ++++++++++++++
+ 2 files changed, 15 insertions(+), 1 deletion(-)
+ create mode 100644 test/Assembler/debug-variant-discriminator.ll
+
+diff --git a/lib/Bitcode/Reader/MetadataLoader.cpp b/lib/Bitcode/Reader/MetadataLoader.cpp
+index 3fe7d2205631..4781cfe3dea6 100644
+--- a/lib/Bitcode/Reader/MetadataLoader.cpp
++++ b/lib/Bitcode/Reader/MetadataLoader.cpp
+@@ -1313,7 +1313,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
+                            (Context, Tag, Name, File, Line, Scope, BaseType,
+                             SizeInBits, AlignInBits, OffsetInBits, Flags,
+                             Elements, RuntimeLang, VTableHolder, TemplateParams,
+-                            Identifier));
++                            Identifier, Discriminator));
+     if (!IsNotUsedInTypeRef && Identifier)
+       MetadataList.addTypeRef(*Identifier, *cast<DICompositeType>(CT));
+ 
+diff --git a/test/Assembler/debug-variant-discriminator.ll b/test/Assembler/debug-variant-discriminator.ll
+new file mode 100644
+index 000000000000..5be001cad6be
+--- /dev/null
++++ b/test/Assembler/debug-variant-discriminator.ll
+@@ -0,0 +1,14 @@
++; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
++; RUN: verify-uselistorder %s
++
++; CHECK: !named = !{!0, !1, !2}
++!named = !{!0, !1, !2}
++
++; CHECK: !0 = !DICompositeType(tag: DW_TAG_structure_type, name: "Outer", size: 64, align: 64, identifier: "Outer")
++; CHECK-NEXT: !1 = !DICompositeType(tag: DW_TAG_variant_part, scope: !0, size: 64, discriminator: !2)
++; CHECK-NEXT: !2 = !DIDerivedType(tag: DW_TAG_member, scope: !1, baseType: !3, size: 64, align: 64, flags: DIFlagArtificial)
++; CHECK-NEXT: !3 = !DIBasicType(name: "u64", size: 64, encoding: DW_ATE_unsigned)
++!0 = !DICompositeType(tag: DW_TAG_structure_type, name: "Outer", size: 64, align: 64, identifier: "Outer")
++!1 = !DICompositeType(tag: DW_TAG_variant_part, scope: !0, size: 64, discriminator: !2)
++!2 = !DIDerivedType(tag: DW_TAG_member, scope: !1, baseType: !3, size: 64, align: 64, flags: DIFlagArtificial)
++!3 = !DIBasicType(name: "u64", size: 64, encoding: DW_ATE_unsigned)


More information about the arch-commits mailing list