The package rpms/llvm.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/llvm.git/commit/?id=165caa696e4bb...
https://src.fedoraproject.org/cgit/rpms/llvm.git/commit/?id=c96d6793e9e41....
Change:
+%ifarch %{gold_arches}
+%ifarch %{valgrind_arches}
Thanks.
Full change:
============
commit 165caa696e4bb066cfad2523e14d846a85fe7d57
Author: Tom Stellard <tstellar(a)redhat.com>
Date: Wed Aug 29 03:35:53 2018 +0000
Build the gold plugin on all supported architectures
rhbz#1623305
diff --git a/llvm.spec b/llvm.spec
index 9c24d27..0cd4698 100644
--- a/llvm.spec
+++ b/llvm.spec
@@ -1,6 +1,7 @@
#global debug_package %%{nil}
# Components enabled if supported by target architecture:
-%ifarch %ix86 x86_64
+%define gold_arches %{ix86} x86_64 %{arm} aarch64 %{power64} s390x
+%ifarch %{gold_arches}
%bcond_without gold
%else
%bcond_with gold
@@ -50,7 +51,7 @@
Name: %{pkg_name}
Version: %{maj_ver}.%{min_ver}.%{patch_ver}
-Release: 0.8.rc%{rc_ver}%{?dist}
+Release: 0.9.rc%{rc_ver}%{?dist}
Summary: The Low Level Virtual Machine
License: NCSA
@@ -410,6 +411,9 @@ fi
%endif
%changelog
+* Thu Aug 30 2018 Tom Stellard <tstellar(a)redhat.com> - 7.0.0-0.9.rc2
+- Build the gold plugin on all supported architectures
+
* Wed Aug 29 2018 Kevin Fenzi <kevin(a)scrye.com> - 7.0.0-0.8.rc2
- Re-enable debuginfo to avoid 25x size increase.
commit a057ddec79b1e42141b7ccb00a64a3b1fd2779a5
Author: Kevin Fenzi <kevin(a)scrye.com>
Date: Wed Aug 29 16:03:47 2018 -0700
Re-enable debuginfo to avoid 25x size increase.
diff --git a/llvm.spec b/llvm.spec
index 10b03ce..9c24d27 100644
--- a/llvm.spec
+++ b/llvm.spec
@@ -1,4 +1,4 @@
-%global debug_package %{nil}
+#global debug_package %%{nil}
# Components enabled if supported by target architecture:
%ifarch %ix86 x86_64
%bcond_without gold
@@ -50,7 +50,7 @@
Name: %{pkg_name}
Version: %{maj_ver}.%{min_ver}.%{patch_ver}
-Release: 0.7.rc%{rc_ver}%{?dist}
+Release: 0.8.rc%{rc_ver}%{?dist}
Summary: The Low Level Virtual Machine
License: NCSA
@@ -410,6 +410,9 @@ fi
%endif
%changelog
+* Wed Aug 29 2018 Kevin Fenzi <kevin(a)scrye.com> - 7.0.0-0.8.rc2
+- Re-enable debuginfo to avoid 25x size increase.
+
* Tue Aug 28 2018 Tom Stellard <tstellar(a)redhat.com> - 7.0.0-0.7.rc2
- 7.0.0-rc2 Release
commit 1bf09a7cfb57e9e49bb0c1b05abe33aaef60e1b7
Author: Tom Stellard <tstellar(a)redhat.com>
Date: Tue Aug 28 17:53:32 2018 +0000
7.0.0-rc2 Release
diff --git a/.gitignore b/.gitignore
index 72c8511..02c09e2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,3 +41,4 @@
/llvm-6.0.1rc2.src.tar.xz
/llvm-6.0.1.src.tar.xz
/llvm-7.0.0rc1.src.tar.xz
+/llvm-7.0.0rc2.src.tar.xz
diff --git a/0001-Don-t-run-BV-DAG-Combine-before-legalization-if-it-a.patch
b/0001-Don-t-run-BV-DAG-Combine-before-legalization-if-it-a.patch
deleted file mode 100644
index 31d2b44..0000000
--- a/0001-Don-t-run-BV-DAG-Combine-before-legalization-if-it-a.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 2eb830fed5b813c5624e770c244eec61dacb04d7 Mon Sep 17 00:00:00 2001
-From: Tom Stellard <tstellar(a)redhat.com>
-Date: Mon, 9 Jul 2018 10:35:30 -0700
-Subject: [PATCH] Don't run BV DAG Combine before legalization if it assumes
- legal types
-
----
- lib/Target/PowerPC/PPCISelLowering.cpp | 13 ++++++++++---
- 1 file changed, 10 insertions(+), 3 deletions(-)
-
-diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp
b/lib/Target/PowerPC/PPCISelLowering.cpp
-index 26e9f13..f622b05 100644
---- a/lib/Target/PowerPC/PPCISelLowering.cpp
-+++ b/lib/Target/PowerPC/PPCISelLowering.cpp
-@@ -11790,10 +11790,15 @@ static SDValue combineBVOfVecSExt(SDNode *N, SelectionDAG
&DAG) {
- auto isSExtOfVecExtract = [&](SDValue Op) -> bool {
- if (!Op)
- return false;
-- if (Op.getOpcode() != ISD::SIGN_EXTEND)
-+ if (Op.getOpcode() != ISD::SIGN_EXTEND &&
-+ Op.getOpcode() != ISD::SIGN_EXTEND_INREG)
- return false;
-
-+ // A SIGN_EXTEND_INREG might be fed by an ANY_EXTEND to produce a value
-+ // of the right width.
- SDValue Extract = Op.getOperand(0);
-+ if (Extract.getOpcode() == ISD::ANY_EXTEND)
-+ Extract = Extract.getOperand(0);
- if (Extract.getOpcode() != ISD::EXTRACT_VECTOR_ELT)
- return false;
-
-@@ -11881,8 +11886,10 @@ SDValue PPCTargetLowering::DAGCombineBuildVector(SDNode *N,
- return Reduced;
-
- // If we're building a vector out of extended elements from another vector
-- // we have P9 vector integer extend instructions.
-- if (Subtarget.hasP9Altivec()) {
-+ // we have P9 vector integer extend instructions. The code assumes legal
-+ // input types (i.e. it can't handle things like v4i16) so do not run before
-+ // legalization.
-+ if (Subtarget.hasP9Altivec() && !DCI.isBeforeLegalize()) {
- Reduced = combineBVOfVecSExt(N, DAG);
- if (Reduced)
- return Reduced;
---
-1.8.3.1
-
diff --git a/0001-bpf-fix-an-assertion-in-BPFAsmBackend-applyFixup.patch
b/0001-bpf-fix-an-assertion-in-BPFAsmBackend-applyFixup.patch
new file mode 100644
index 0000000..7a5831c
--- /dev/null
+++ b/0001-bpf-fix-an-assertion-in-BPFAsmBackend-applyFixup.patch
@@ -0,0 +1,77 @@
+From 39184e407cd937f2f20d3f61eec205925bae7b13 Mon Sep 17 00:00:00 2001
+From: Yonghong Song <yhs(a)fb.com>
+Date: Wed, 22 Aug 2018 21:21:03 +0000
+Subject: [PATCH] bpf: fix an assertion in BPFAsmBackend applyFixup()
+
+Fix bug
https://bugs.llvm.org/show_bug.cgi?id=38643
+
+In BPFAsmBackend applyFixup(), there is an assertion for FixedValue to be 0.
+This may not be true, esp. for optimiation level 0.
+For example, in the above bug, for the following two
+static variables:
+ @bpf_map_lookup_elem = internal global i8* (i8*, i8*)*
+ inttoptr (i64 1 to i8* (i8*, i8*)*), align 8
+ @bpf_map_update_elem = internal global i32 (i8*, i8*, i8*, i64)*
+ inttoptr (i64 2 to i32 (i8*, i8*, i8*, i64)*), align 8
+
+The static variable @bpf_map_update_elem will have a symbol
+offset of 8 and a FK_SecRel_8 with FixupValue 8 will cause
+the assertion if llvm is built with -DLLVM_ENABLE_ASSERTIONS=ON.
+
+The above relocations will not exist if the program is compiled
+with optimization level -O1 and above as the compiler optimizes
+those static variables away. In the below error message, -O2
+is suggested as this is the common practice.
+
+Note that FixedValue = 0 in applyFixup() does exist and is valid,
+e.g., for the global variable my_map in the above bug. The bpf
+loader will process them properly for map_id's before loading
+the program into the kernel.
+
+The static variables, which are not optimized away by compiler,
+may have FK_SecRel_8 relocation with non-zero FixedValue.
+
+The patch removed the offending assertion and will issue
+a hard error as below if the FixedValue in applyFixup()
+is not 0.
+ $ llc -march=bpf -filetype=obj fixup.ll
+ LLVM ERROR: Unsupported relocation: try to compile with -O2 or above,
+ or check your static variable usage
+
+Signed-off-by: Yonghong Song <yhs(a)fb.com>
+
+git-svn-id:
https://llvm.org/svn/llvm-project/llvm/trunk@340455
91177308-0d34-0410-b5e6-96231b3b80d8
+---
+ lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp
b/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp
+index 6c255e9..1822d86 100644
+--- a/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp
++++ b/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp
+@@ -10,6 +10,8 @@
+ #include "MCTargetDesc/BPFMCTargetDesc.h"
+ #include "llvm/ADT/StringRef.h"
+ #include "llvm/MC/MCAsmBackend.h"
++#include "llvm/MC/MCAssembler.h"
++#include "llvm/MC/MCContext.h"
+ #include "llvm/MC/MCFixup.h"
+ #include "llvm/MC/MCObjectWriter.h"
+ #include "llvm/Support/EndianStream.h"
+@@ -71,7 +73,12 @@ void BPFAsmBackend::applyFixup(const MCAssembler &Asm, const
MCFixup &Fixup,
+ bool IsResolved,
+ const MCSubtargetInfo *STI) const {
+ if (Fixup.getKind() == FK_SecRel_4 || Fixup.getKind() == FK_SecRel_8) {
+- assert(Value == 0);
++ if (Value) {
++ MCContext &Ctx = Asm.getContext();
++ Ctx.reportError(Fixup.getLoc(),
++ "Unsupported relocation: try to compile with -O2 or above,
"
++ "or check your static variable usage");
++ }
+ } else if (Fixup.getKind() == FK_Data_4) {
+ support::endian::write<uint32_t>(&Data[Fixup.getOffset()], Value,
Endian);
+ } else if (Fixup.getKind() == FK_Data_8) {
+--
+1.8.3.1
+
diff --git a/0001-gold-Fix-Tests-cases-on-i686.patch
b/0001-gold-Fix-Tests-cases-on-i686.patch
deleted file mode 100644
index f35db4f..0000000
--- a/0001-gold-Fix-Tests-cases-on-i686.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-From bda67d3141acf120df8db57052603e9a18d86523 Mon Sep 17 00:00:00 2001
-From: Tom Stellard <tstellar(a)redhat.com>
-Date: Fri, 10 Aug 2018 14:54:17 -0700
-Subject: [PATCH] [gold] Fix Tests cases on i686
-
----
- test/tools/gold/X86/common.ll | 10 +++++-----
- test/tools/gold/X86/v1.16/wrap-1.ll | 4 ++--
- test/tools/gold/X86/v1.16/wrap-2.ll | 4 ++--
- 3 files changed, 9 insertions(+), 9 deletions(-)
-
-diff --git a/test/tools/gold/X86/common.ll b/test/tools/gold/X86/common.ll
-index 1debe78..d8b4e03 100644
---- a/test/tools/gold/X86/common.ll
-+++ b/test/tools/gold/X86/common.ll
-@@ -8,7 +8,7 @@ target triple = "x86_64-unknown-linux-gnu"
-
- @a = common global i16 0, align 8
-
--; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \
-+; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \
- ; RUN: --plugin-opt=emit-llvm \
- ; RUN: -shared %t1.o %t2.o -o %t3.o
- ; RUN: llvm-dis %t3.o -o - | FileCheck %s --check-prefix=A
-@@ -16,7 +16,7 @@ target triple = "x86_64-unknown-linux-gnu"
- ; Shared library case, we merge @a as common and keep it for the symbol table.
- ; A: @a = common global [4 x i8] zeroinitializer, align 8
-
--; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \
-+; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \
- ; RUN: --plugin-opt=emit-llvm \
- ; RUN: -shared %t1.o %t2b.o -o %t3.o
- ; RUN: llvm-dis %t3.o -o - | FileCheck %s --check-prefix=B
-@@ -24,7 +24,7 @@ target triple = "x86_64-unknown-linux-gnu"
- ; (i16 align 8) + (i8 align 16) = i16 align 16
- ; B: @a = common global i16 0, align 16
-
--; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \
-+; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \
- ; RUN: --plugin-opt=emit-llvm \
- ; RUN: -shared %t1.o %t2c.o -o %t3.o
- ; RUN: llvm-dis %t3.o -o - | FileCheck %s --check-prefix=C
-@@ -32,7 +32,7 @@ target triple = "x86_64-unknown-linux-gnu"
- ; (i16 align 8) + (i8 align 1) = i16 align 8.
- ; C: @a = common global i16 0, align 8
-
--; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \
-+; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \
- ; RUN: --plugin-opt=emit-llvm \
- ; RUN: %t1.o %t2.o -o %t3.o
- ; RUN: llvm-dis %t3.o -o - | FileCheck --check-prefix=EXEC %s
-@@ -41,7 +41,7 @@ target triple = "x86_64-unknown-linux-gnu"
- ; EXEC: @a = internal global [4 x i8] zeroinitializer, align 8
-
- ; RUN: llc %p/Inputs/common.ll -o %t2native.o -filetype=obj
--; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \
-+; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \
- ; RUN: --plugin-opt=emit-llvm \
- ; RUN: %t1.o %t2native.o -o %t3.o
- ; RUN: llvm-dis %t3.o -o - | FileCheck --check-prefix=MIXED %s
-diff --git a/test/tools/gold/X86/v1.16/wrap-1.ll b/test/tools/gold/X86/v1.16/wrap-1.ll
-index 5ea83b0..806442e 100644
---- a/test/tools/gold/X86/v1.16/wrap-1.ll
-+++ b/test/tools/gold/X86/v1.16/wrap-1.ll
-@@ -1,12 +1,12 @@
- ; LTO
- ; RUN: llvm-as %s -o %t.o
--; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext %t.o -o %t.out -wrap=bar
-plugin-opt=save-temps
-+; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext %t.o -o %t.out
-wrap=bar -plugin-opt=save-temps
- ; RUN: llvm-readobj -t %t.out | FileCheck %s
- ; RUN: cat %t.out.resolution.txt | FileCheck -check-prefix=RESOLS %s
-
- ; ThinLTO
- ; RUN: opt -module-summary %s -o %t.o
--; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext %t.o -o %t.out -wrap=bar
-plugin-opt=save-temps
-+; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext %t.o -o %t.out
-wrap=bar -plugin-opt=save-temps
- ; RUN: llvm-readobj -t %t.out | FileCheck %s
- ; RUN: cat %t.out.resolution.txt | FileCheck -check-prefix=RESOLS %s
-
-diff --git a/test/tools/gold/X86/v1.16/wrap-2.ll b/test/tools/gold/X86/v1.16/wrap-2.ll
-index 7c1d95d..f36456c 100644
---- a/test/tools/gold/X86/v1.16/wrap-2.ll
-+++ b/test/tools/gold/X86/v1.16/wrap-2.ll
-@@ -7,14 +7,14 @@
- ; LTO defsym handling, gold will need a fix (not the gold plugin).
- ; RUN-TODO: llvm-as %s -o %t.o
- ; RUN-TODO: llvm-as %S/Inputs/wrap-bar.ll -o %t1.o
--; RUN-TODO: %gold -plugin %llvmshlibdir/LLVMgold%shlibext %t.o %t1.o -shared -o %t.so
-wrap=bar
-+; RUN-TODO: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext %t.o %t1.o
-shared -o %t.so -wrap=bar
- ; RUN-TODO: llvm-objdump -d %t.so | FileCheck %s
- ; RUN-TODO: llvm-readobj -t %t.so | FileCheck -check-prefix=BIND %s
-
- ; ThinLTO
- ; RUN: opt -module-summary %s -o %t.o
- ; RUN: opt -module-summary %S/Inputs/wrap-bar.ll -o %t1.o
--; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext %t.o %t1.o -shared -o %t.so
-wrap=bar
-+; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext %t.o %t1.o -shared -o
%t.so -wrap=bar
- ; RUN: llvm-objdump -d %t.so | FileCheck %s -check-prefix=THIN
- ; RUN: llvm-readobj -t %t.so | FileCheck -check-prefix=BIND %s
-
---
-1.8.3.1
-
diff --git a/llvm.spec b/llvm.spec
index b6e2b71..10b03ce 100644
--- a/llvm.spec
+++ b/llvm.spec
@@ -12,7 +12,7 @@
%global maj_ver 7
%global min_ver 0
%global patch_ver 0
-%global rc_ver 1
+%global rc_ver 2
%ifarch s390x
%global llvm_targets SystemZ;BPF
@@ -50,7 +50,7 @@
Name: %{pkg_name}
Version: %{maj_ver}.%{min_ver}.%{patch_ver}
-Release: 0.6.rc%{rc_ver}%{?dist}
+Release: 0.7.rc%{rc_ver}%{?dist}
Summary: The Low Level Virtual Machine
License: NCSA
@@ -61,9 +61,9 @@ Source1: run-lit-tests
Patch3: 0001-CMake-Split-static-library-exports-into-their-own-ex.patch
Patch7: 0001-Filter-out-cxxflags-not-supported-by-clang.patch
-Patch10: 0001-Don-t-run-BV-DAG-Combine-before-legalization-if-it-a.patch
-Patch11: 0001-gold-Fix-Tests-cases-on-i686.patch
Patch12: 0001-unittests-Don-t-install-TestPlugin.so.patch
+# rhbz#1618958
+Patch13: 0001-bpf-fix-an-assertion-in-BPFAsmBackend-applyFixup.patch
BuildRequires: gcc
BuildRequires: gcc-c++
@@ -410,6 +410,9 @@ fi
%endif
%changelog
+* Tue Aug 28 2018 Tom Stellard <tstellar(a)redhat.com> - 7.0.0-0.7.rc2
+- 7.0.0-rc2 Release
+
* Tue Aug 28 2018 Tom Stellard <tstellar(a)redhat.com> - 7.0.0-0.6.rc1
- Guard valgrind usage with valgrind_arches macro
diff --git a/sources b/sources
index 49e0836..f1fbd2c 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (llvm-7.0.0rc1.src.tar.xz) =
9fe5de3b373e3e9f32b81ac920dfbb6fd6a03118f0c1e9c2b6d93a0a0742c122d5c08e97c71262a7c273badb1d336b813143c1055d7c49c22394151a1520e064
+SHA512 (llvm-7.0.0rc2.src.tar.xz) =
4211fdbd2278ed325d3f6a1f1fa706351e768e2cd1445abf6664bed39b7b5d0c5e04514711d627f9ae1e271300f410635bb54ba004a5bece0d68450d3a1b52e4
commit c96d6793e9e411070a3587c63c88d590017e1ab8
Author: Tom Stellard <tstellar(a)redhat.com>
Date: Tue Aug 28 05:46:20 2018 +0000
Guard valgrind usage with valgrind_arches macro
diff --git a/llvm.spec b/llvm.spec
index b1f8ba2..b6e2b71 100644
--- a/llvm.spec
+++ b/llvm.spec
@@ -50,7 +50,7 @@
Name: %{pkg_name}
Version: %{maj_ver}.%{min_ver}.%{patch_ver}
-Release: 0.5.rc%{rc_ver}%{?dist}
+Release: 0.6.rc%{rc_ver}%{?dist}
Summary: The Low Level Virtual Machine
License: NCSA
@@ -80,8 +80,10 @@ BuildRequires: multilib-rpm-config
BuildRequires: binutils-devel
%endif
BuildRequires: libstdc++-static
+%ifarch %{valgrind_arches}
# Enable extra functionality when run the LLVM JIT under valgrind.
BuildRequires: valgrind-devel
+%endif
# LLVM's LineEditor library will use libedit if it is available.
BuildRequires: libedit-devel
@@ -408,6 +410,9 @@ fi
%endif
%changelog
+* Tue Aug 28 2018 Tom Stellard <tstellar(a)redhat.com> - 7.0.0-0.6.rc1
+- Guard valgrind usage with valgrind_arches macro
+
* Thu Aug 23 2018 Tom Stellard <tstellar(a)redhat.com> - 7.0.0-0.5.rc1
- Package lit tests and googletest sources.
commit a47388f920237b801b73638a4c8fc4aa77ba866f
Author: Tom Stellard <tstellar(a)redhat.com>
Date: Mon Mar 19 16:26:08 2018 +0000
Package lit tests and googletest sources
diff --git a/llvm.spec b/llvm.spec
index cfd88ce..b1f8ba2 100644
--- a/llvm.spec
+++ b/llvm.spec
@@ -1,3 +1,4 @@
+%global debug_package %{nil}
# Components enabled if supported by target architecture:
%ifarch %ix86 x86_64
%bcond_without gold
@@ -49,12 +50,13 @@
Name: %{pkg_name}
Version: %{maj_ver}.%{min_ver}.%{patch_ver}
-Release: 0.4.rc%{rc_ver}%{?dist}
+Release: 0.5.rc%{rc_ver}%{?dist}
Summary: The Low Level Virtual Machine
License: NCSA
URL:
http://llvm.org
Source0: http://%{?rc_ver:pre}releases.llvm.org/%{version}/%{?rc_ver:rc%{rc_ver}}/llvm-%{version}%{?rc_ver:rc%{rc_ver}}.src.tar.xz
+Source1: run-lit-tests
Patch3: 0001-CMake-Split-static-library-exports-into-their-own-ex.patch
Patch7: 0001-Filter-out-cxxflags-not-supported-by-clang.patch
@@ -125,6 +127,24 @@ Summary: LLVM static libraries
%description static
Static libraries for the LLVM compiler infrastructure.
+%if !0%{?compat_build}
+
+%package test
+Summary: LLVM regression tests.
+
+%description test
+LLVM regression tests.
+Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: python3-lit
+
+%package googletest
+Summary: LLVM's modified googletest sources.
+
+%description googletest
+LLVM's modified googletest sources.
+
+%endif
+
%prep
%autosetup -n llvm-%{version}%{?rc_ver:rc%{rc_ver}}.src -p1
@@ -209,6 +229,44 @@ mv -v %{buildroot}%{_bindir}/llvm-config{,-%{__isa_bits}}
%multilib_fix_c_header --file %{_includedir}/llvm/Config/llvm-config.h
+# Install binaries needed for lit tests
+%global test_binaries lli-child-target llvm-isel-fuzzer llvm-opt-fuzzer yaml-bench
+for f in %{test_binaries}; do
+install -m 0755 ./bin/$f %{buildroot}%{llvm_bindir}
+done
+
+%global install_srcdir %{buildroot}%{_datadir}/llvm/src
+%global lit_cfg test/lit.site.cfg.py
+%global lit_unit_cfg test/Unit/lit.site.cfg.py
+
+cd ..
+
+# Install gtest sources so clang can use them for gtest
+install -d %{install_srcdir}
+install -d %{install_srcdir}/utils/
+cp -R utils/unittest %{install_srcdir}/utils/
+
+# Generate lit config files.
+cat _build/test/lit.site.cfg.py >> %{lit_cfg}
+cat _build/test/Unit/lit.site.cfg.py >> %{lit_unit_cfg}
+sed -i -e s~`pwd`/_build~%{_prefix}~g -e s~`pwd`~.~g %{lit_cfg} %{lit_cfg}
%{lit_unit_cfg}
+
+# obj_root needs to be set to the directory containing the unit test binaries.
+sed -i 's~\(config.llvm_obj_root =
\)"[^"]\+"~\1"%{llvm_bindir}"~' %{lit_unit_cfg}
+
+install -d %{buildroot}%{_libexecdir}/tests/llvm
+install -m 0755 %{SOURCE1} %{buildroot}%{_libexecdir}/tests/llvm
+
+# Install lit tests. We need to put these in a tarball otherwise rpm will complain
+# about some of the test inputs having the wrong object file format.
+install -d %{buildroot}%{_datadir}/llvm/
+tar -czf %{install_srcdir}/test.tar.gz test/
+
+# Install the unit test binaries
+cp -R _build/unittests %{buildroot}%{llvm_bindir}/
+# FIXME: Can't figure out how to make the find command succeed.
+find %{buildroot}%{llvm_bindir} -ignore_readdir_race -iname 'cmake*' -exec rm -Rf
'{}' ';' || true
+
%else
# Add version suffix to binaries
@@ -272,6 +330,7 @@ fi
%exclude %{_bindir}/llvm-config-%{__isa_bits}
%exclude %{_mandir}/man1/llvm-config.1.*
%{_datadir}/opt-viewer
+%exclude %{llvm_bindir}/unittests
%else
%config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf
%exclude %{pkg_bindir}/llvm-config
@@ -332,7 +391,26 @@ fi
%{_libdir}/%{name}/lib/*.a
%endif
+%if !0%{?compat_build}
+
+%files test
+%{_libexecdir}/tests/llvm/
+%{llvm_bindir}/unittests/
+%{_datadir}/llvm/src/test.tar.gz
+%{llvm_bindir}/yaml-bench
+%{llvm_bindir}/lli-child-target
+%{llvm_bindir}/llvm-isel-fuzzer
+%{llvm_bindir}/llvm-opt-fuzzer
+
+%files googletest
+%{_datadir}/llvm/src/utils
+
+%endif
+
%changelog
+* Thu Aug 23 2018 Tom Stellard <tstellar(a)redhat.com> - 7.0.0-0.5.rc1
+- Package lit tests and googletest sources.
+
* Mon Aug 20 2018 Tom Stellard <tstellar(a)redhat.com> - 7.0.0-0.4.rc1
- Re-enable AMDGPU target on ARM rhbz#1618922
diff --git a/run-lit-tests b/run-lit-tests
new file mode 100755
index 0000000..12fae3e
--- /dev/null
+++ b/run-lit-tests
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+set -xe
+
+#lit -v /usr/share/llvm/src/test
+
+TOOLS_DIR=/usr/lib64/llvm
+cd $(mktemp -d)
+tar -xzf /usr/share/llvm/src/test.tar.gz
+lit test \
+ -DFileCheck=$TOOLS_DIR/FileCheck \
+ -Dcount=$TOOlS_DIR/count \
+ -Dnot=$TOOLS_DIR/not \
+ -Dlli-child-target=$TOOLS_DIR/lli-child-target \
+ -Dllvm-isel-fuzzer=$TOOLS_DIR/llvm-isel-fuzzer \
+ -Dllvm-opt-fuzzer=$TOOLS_DIR/llvm-opt-fuzzer \
+ -Dyaml-bench$TOOLS_DIR/yaml-bench
diff --git a/tests/tests.yml b/tests/tests.yml
new file mode 100644
index 0000000..6cc4703
--- /dev/null
+++ b/tests/tests.yml
@@ -0,0 +1,11 @@
+- hosts: localhost
+ roles:
+ - role: standard-test-basic
+ tags:
+ - classic
+ required_packages:
+ - llvm-test
+ tests:
+ - rhbz#482491:
+ dir: ./
+ run: /usr/libexec/tests/llvm/run-lit-tests
commit 1948d64c186e33ddb7c1030194d679e53c0933da
Author: Tom Stellard <tstellar(a)redhat.com>
Date: Mon Aug 20 17:46:15 2018 +0000
Re-enable AMDGPU target on ARM rhbz#1618922
diff --git a/llvm.spec b/llvm.spec
index 28a2309..cfd88ce 100644
--- a/llvm.spec
+++ b/llvm.spec
@@ -26,7 +26,7 @@
%global llvm_targets AArch64;AMDGPU;BPF
%endif
%ifarch %{arm}
-%global llvm_targets ARM;BPF
+%global llvm_targets ARM;AMDGPU;BPF
%endif
%if 0%{?compat_build}
@@ -49,7 +49,7 @@
Name: %{pkg_name}
Version: %{maj_ver}.%{min_ver}.%{patch_ver}
-Release: 0.3.rc%{rc_ver}%{?dist}
+Release: 0.4.rc%{rc_ver}%{?dist}
Summary: The Low Level Virtual Machine
License: NCSA
@@ -333,6 +333,9 @@ fi
%endif
%changelog
+* Mon Aug 20 2018 Tom Stellard <tstellar(a)redhat.com> - 7.0.0-0.4.rc1
+- Re-enable AMDGPU target on ARM rhbz#1618922
+
* Mon Aug 13 2018 Tom Stellard <tstellar(a)redhat.com> - 7.0.0-0.3.rc1
- Drop references to TestPlugin.so from cmake files