Compare commits

...

No commits in common. "c8-stream-rhel8" and "stream-llvm-toolset-rhel8-rhel-8.9.0" have entirely different histories.

24 changed files with 601 additions and 19 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

15
.gitignore vendored
View File

@ -1,3 +1,18 @@
SOURCES/cmake-15.0.7.src.tar.xz
SOURCES/llvm-15.0.7.src.tar.xz
SOURCES/release-keys.asc
/cmake-15.0.7.src.tar.xz
/llvm-15.0.7.src.tar.xz
/release-keys.asc
/llvm-16.0.0.src.tar.xz
/llvm-16.0.0.src.tar.xz.sig
/cmake-16.0.0.src.tar.xz
/cmake-16.0.0.src.tar.xz.sig
/third-party-16.0.0.src.tar.xz
/third-party-16.0.0.src.tar.xz.sig
/llvm-16.0.6.src.tar.xz
/llvm-16.0.6.src.tar.xz.sig
/cmake-16.0.6.src.tar.xz
/cmake-16.0.6.src.tar.xz.sig
/third-party-16.0.6.src.tar.xz
/third-party-16.0.6.src.tar.xz.sig

View File

@ -1,3 +1,6 @@
8f06060871953422820098346da9a3b63b90120d SOURCES/cmake-15.0.7.src.tar.xz
497ca3b2010cc0e3e38bc9dc6dda19041dbd7066 SOURCES/llvm-15.0.7.src.tar.xz
347bdd5ee6d6b93c9644c268511815912c0fb2dc SOURCES/release-keys.asc
072d2fb4b10f95d06189de00eb7f7e9b35c54e9a llvm-16.0.6.src.tar.xz
bfc74b3868c69ce674a583c91e938b6d4cf0fded llvm-16.0.6.src.tar.xz.sig
0de534cfef38697e115c3ae80634765f05e78e5b cmake-16.0.6.src.tar.xz
2db5c88fe9277bb0fa85f49b58e946e49ff235c2 cmake-16.0.6.src.tar.xz.sig
5b1a58de6ed9d154a38edb6386a5749576e0b96a third-party-16.0.6.src.tar.xz
51ad6a8ccc5ccd40faff6f1c98a2f33a9b600f88 third-party-16.0.6.src.tar.xz.sig

View File

@ -0,0 +1,35 @@
From 3df079ae29426b4bee3ca11681a41958d72b983a Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov@redhat.com>
Date: Mon, 31 Jan 2022 10:33:27 +0100
Subject: [PATCH] Disable CrashRecoveryTest.DumpStackCleanup test on aarch64
Produces a non-reproducible failure on aarch64:
https://bugzilla.redhat.com/show_bug.cgi?id=2048440
---
llvm/unittests/Support/CrashRecoveryTest.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/llvm/unittests/Support/CrashRecoveryTest.cpp b/llvm/unittests/Support/CrashRecoveryTest.cpp
index e95513eb2841..afb1d3a1f6a2 100644
--- a/llvm/unittests/Support/CrashRecoveryTest.cpp
+++ b/llvm/unittests/Support/CrashRecoveryTest.cpp
@@ -76,6 +76,7 @@ TEST(CrashRecoveryTest, Cleanup) {
llvm::CrashRecoveryContext::Disable();
}
+#ifndef __aarch64__
TEST(CrashRecoveryTest, DumpStackCleanup) {
SmallString<128> Filename;
std::error_code EC = sys::fs::createTemporaryFile("crash", "test", Filename);
@@ -101,6 +102,7 @@ TEST(CrashRecoveryTest, DumpStackCleanup) {
EXPECT_EQ(GlobalInt, 1);
llvm::CrashRecoveryContext::Disable();
}
+#endif
TEST(CrashRecoveryTest, LimitedStackTrace) {
std::string Res;
--
2.34.1

View File

@ -0,0 +1,184 @@
From efbaf8bc61f4c0e29a3eaafb11ac0ddda8bd3dff Mon Sep 17 00:00:00 2001
From: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Date: Fri, 30 Jun 2023 16:02:56 +0200
Subject: [PATCH] [SystemZ] Improve error messages for unsupported relocations
In the SystemZMCObjectWriter, we currently just abort in case
some unsupported relocation in requested. However, as this
situation can be triggered by invalid (inline) assembler input,
we should really get a regular error message instead.
---
.../MCTargetDesc/SystemZMCObjectWriter.cpp | 59 +++++++++++--------
1 file changed, 35 insertions(+), 24 deletions(-)
diff --git a/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCObjectWriter.cpp b/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCObjectWriter.cpp
index c23463ab9bde..0b11468afc52 100644
--- a/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCObjectWriter.cpp
+++ b/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCObjectWriter.cpp
@@ -9,6 +9,7 @@
#include "MCTargetDesc/SystemZMCFixups.h"
#include "MCTargetDesc/SystemZMCTargetDesc.h"
#include "llvm/BinaryFormat/ELF.h"
+#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCELFObjectWriter.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCFixup.h"
@@ -40,7 +41,7 @@ SystemZObjectWriter::SystemZObjectWriter(uint8_t OSABI)
/*HasRelocationAddend_=*/ true) {}
// Return the relocation type for an absolute value of MCFixupKind Kind.
-static unsigned getAbsoluteReloc(unsigned Kind) {
+static unsigned getAbsoluteReloc(MCContext &Ctx, SMLoc Loc, unsigned Kind) {
switch (Kind) {
case FK_Data_1: return ELF::R_390_8;
case FK_Data_2: return ELF::R_390_16;
@@ -49,11 +50,12 @@ static unsigned getAbsoluteReloc(unsigned Kind) {
case SystemZ::FK_390_12: return ELF::R_390_12;
case SystemZ::FK_390_20: return ELF::R_390_20;
}
- llvm_unreachable("Unsupported absolute address");
+ Ctx.reportError(Loc, "Unsupported absolute address");
+ return 0;
}
// Return the relocation type for a PC-relative value of MCFixupKind Kind.
-static unsigned getPCRelReloc(unsigned Kind) {
+static unsigned getPCRelReloc(MCContext &Ctx, SMLoc Loc, unsigned Kind) {
switch (Kind) {
case FK_Data_2: return ELF::R_390_PC16;
case FK_Data_4: return ELF::R_390_PC32;
@@ -63,62 +65,69 @@ static unsigned getPCRelReloc(unsigned Kind) {
case SystemZ::FK_390_PC24DBL: return ELF::R_390_PC24DBL;
case SystemZ::FK_390_PC32DBL: return ELF::R_390_PC32DBL;
}
- llvm_unreachable("Unsupported PC-relative address");
+ Ctx.reportError(Loc, "Unsupported PC-relative address");
+ return 0;
}
// Return the R_390_TLS_LE* relocation type for MCFixupKind Kind.
-static unsigned getTLSLEReloc(unsigned Kind) {
+static unsigned getTLSLEReloc(MCContext &Ctx, SMLoc Loc, unsigned Kind) {
switch (Kind) {
case FK_Data_4: return ELF::R_390_TLS_LE32;
case FK_Data_8: return ELF::R_390_TLS_LE64;
}
- llvm_unreachable("Unsupported absolute address");
+ Ctx.reportError(Loc, "Unsupported thread-local address (local-exec)");
+ return 0;
}
// Return the R_390_TLS_LDO* relocation type for MCFixupKind Kind.
-static unsigned getTLSLDOReloc(unsigned Kind) {
+static unsigned getTLSLDOReloc(MCContext &Ctx, SMLoc Loc, unsigned Kind) {
switch (Kind) {
case FK_Data_4: return ELF::R_390_TLS_LDO32;
case FK_Data_8: return ELF::R_390_TLS_LDO64;
}
- llvm_unreachable("Unsupported absolute address");
+ Ctx.reportError(Loc, "Unsupported thread-local address (local-dynamic)");
+ return 0;
}
// Return the R_390_TLS_LDM* relocation type for MCFixupKind Kind.
-static unsigned getTLSLDMReloc(unsigned Kind) {
+static unsigned getTLSLDMReloc(MCContext &Ctx, SMLoc Loc, unsigned Kind) {
switch (Kind) {
case FK_Data_4: return ELF::R_390_TLS_LDM32;
case FK_Data_8: return ELF::R_390_TLS_LDM64;
case SystemZ::FK_390_TLS_CALL: return ELF::R_390_TLS_LDCALL;
}
- llvm_unreachable("Unsupported absolute address");
+ Ctx.reportError(Loc, "Unsupported thread-local address (local-dynamic)");
+ return 0;
}
// Return the R_390_TLS_GD* relocation type for MCFixupKind Kind.
-static unsigned getTLSGDReloc(unsigned Kind) {
+static unsigned getTLSGDReloc(MCContext &Ctx, SMLoc Loc, unsigned Kind) {
switch (Kind) {
case FK_Data_4: return ELF::R_390_TLS_GD32;
case FK_Data_8: return ELF::R_390_TLS_GD64;
case SystemZ::FK_390_TLS_CALL: return ELF::R_390_TLS_GDCALL;
}
- llvm_unreachable("Unsupported absolute address");
+ Ctx.reportError(Loc, "Unsupported thread-local address (general-dynamic)");
+ return 0;
}
// Return the PLT relocation counterpart of MCFixupKind Kind.
-static unsigned getPLTReloc(unsigned Kind) {
+static unsigned getPLTReloc(MCContext &Ctx, SMLoc Loc, unsigned Kind) {
switch (Kind) {
case SystemZ::FK_390_PC12DBL: return ELF::R_390_PLT12DBL;
case SystemZ::FK_390_PC16DBL: return ELF::R_390_PLT16DBL;
case SystemZ::FK_390_PC24DBL: return ELF::R_390_PLT24DBL;
case SystemZ::FK_390_PC32DBL: return ELF::R_390_PLT32DBL;
}
- llvm_unreachable("Unsupported absolute address");
+ Ctx.reportError(Loc, "Unsupported PC-relative PLT address");
+ return 0;
}
unsigned SystemZObjectWriter::getRelocType(MCContext &Ctx,
const MCValue &Target,
const MCFixup &Fixup,
bool IsPCRel) const {
+ SMLoc Loc = Fixup.getLoc();
unsigned Kind = Fixup.getKind();
if (Kind >= FirstLiteralRelocationKind)
return Kind - FirstLiteralRelocationKind;
@@ -126,38 +135,40 @@ unsigned SystemZObjectWriter::getRelocType(MCContext &Ctx,
switch (Modifier) {
case MCSymbolRefExpr::VK_None:
if (IsPCRel)
- return getPCRelReloc(Kind);
- return getAbsoluteReloc(Kind);
+ return getPCRelReloc(Ctx, Loc, Kind);
+ return getAbsoluteReloc(Ctx, Loc, Kind);
case MCSymbolRefExpr::VK_NTPOFF:
assert(!IsPCRel && "NTPOFF shouldn't be PC-relative");
- return getTLSLEReloc(Kind);
+ return getTLSLEReloc(Ctx, Loc, Kind);
case MCSymbolRefExpr::VK_INDNTPOFF:
if (IsPCRel && Kind == SystemZ::FK_390_PC32DBL)
return ELF::R_390_TLS_IEENT;
- llvm_unreachable("Only PC-relative INDNTPOFF accesses are supported for now");
+ Ctx.reportError(Loc, "Only PC-relative INDNTPOFF accesses are supported for now");
+ return 0;
case MCSymbolRefExpr::VK_DTPOFF:
assert(!IsPCRel && "DTPOFF shouldn't be PC-relative");
- return getTLSLDOReloc(Kind);
+ return getTLSLDOReloc(Ctx, Loc, Kind);
case MCSymbolRefExpr::VK_TLSLDM:
assert(!IsPCRel && "TLSLDM shouldn't be PC-relative");
- return getTLSLDMReloc(Kind);
+ return getTLSLDMReloc(Ctx, Loc, Kind);
case MCSymbolRefExpr::VK_TLSGD:
assert(!IsPCRel && "TLSGD shouldn't be PC-relative");
- return getTLSGDReloc(Kind);
+ return getTLSGDReloc(Ctx, Loc, Kind);
case MCSymbolRefExpr::VK_GOT:
if (IsPCRel && Kind == SystemZ::FK_390_PC32DBL)
return ELF::R_390_GOTENT;
- llvm_unreachable("Only PC-relative GOT accesses are supported for now");
+ Ctx.reportError(Loc, "Only PC-relative GOT accesses are supported for now");
+ return 0;
case MCSymbolRefExpr::VK_PLT:
- assert(IsPCRel && "@PLT shouldt be PC-relative");
- return getPLTReloc(Kind);
+ assert(IsPCRel && "@PLT shouldn't be PC-relative");
+ return getPLTReloc(Ctx, Loc, Kind);
default:
llvm_unreachable("Modifier not supported");
--
2.41.0

View File

@ -0,0 +1,75 @@
From 3dc5722d5c7673a879f2b4680369d3ac8b6b64b6 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Wed, 4 Aug 2021 14:05:38 -0700
Subject: [PATCH] cmake: Allow shared libraries to customize the soname using
LLVM_ABI_REVISION
The LLVM_ABI_REVISION variable is intended to be used for release
candidates which introduce an ABI change to a shared library. This
variable can be specified per library, so there is not one global value
for all of LLVM.
For example, if we LLVM X.0.0-rc2 introduces an ABI change for a library
compared with LLVM X.0.0-rc1, then the LLVM_ABI_REVISION number for
library will be incremented by 1.
In the main branch, LLVM_ABI_REVISION should always be 0, it is only
meant to be used in the release branch.
Differential Revision: https://reviews.llvm.org/D105594
---
llvm/cmake/modules/AddLLVM.cmake | 7 +++++--
llvm/tools/llvm-shlib/CMakeLists.txt | 9 +++++++++
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 3e009f5061d3..a09405a1be3e 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -586,11 +586,14 @@ function(llvm_add_library name)
# Set SOVERSION on shared libraries that lack explicit SONAME
# specifier, on *nix systems that are not Darwin.
if(UNIX AND NOT APPLE AND NOT ARG_SONAME)
+ if (NOT LLVM_ABI_REVISION)
+ set(LLVM_ABI_REVISION 0)
+ endif()
set_target_properties(${name}
PROPERTIES
# Since 4.0.0, the ABI version is indicated by the major version
- SOVERSION ${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}
- VERSION ${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX})
+ SOVERSION ${LLVM_VERSION_MAJOR}.${LLVM_ABI_REVISION}
+ VERSION ${LLVM_VERSION_MAJOR}.${LLVM_ABI_REVISION})
endif()
endif()
diff --git a/llvm/tools/llvm-shlib/CMakeLists.txt b/llvm/tools/llvm-shlib/CMakeLists.txt
index 76b9a25cbbcd..b876e7fed6b5 100644
--- a/llvm/tools/llvm-shlib/CMakeLists.txt
+++ b/llvm/tools/llvm-shlib/CMakeLists.txt
@@ -2,6 +2,11 @@
# library is enabled by setting LLVM_BUILD_LLVM_DYLIB=yes on the CMake
# commandline. By default the shared library only exports the LLVM C API.
+# In the main branch, LLVM_ABI_REVISION should always be 0. In the release
+# branches, this should be incremented before each release candidate every
+# time the ABI of libLLVM.so changes.
+set(LLVM_ABI_REVISION 0 CACHE STRING "ABI Revision number for SONAMEs (default: 0)")
+
set(SOURCES
libllvm.cpp
)
@@ -67,6 +72,10 @@ if(LLVM_BUILD_LLVM_DYLIB)
set_property(TARGET LLVM APPEND_STRING PROPERTY
LINK_FLAGS
" -compatibility_version 1 -current_version ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}")
+ else()
+ set_target_properties(LLVM
+ PROPERTIES
+ SOVERSION ${LLVM_ABI_REVISION})
endif()
if(TARGET libLLVMExports)
--
2.27.0

View File

@ -0,0 +1,32 @@
From 8cc3870f09d728d9017c72eba9520117a4283fee Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Thu, 17 Nov 2022 09:01:10 +0000
Subject: Add install targets for gtest
Stand-alone builds need an installed version of gtest in order to run
the unittests.
Differential Revision: https://reviews.llvm.org/D137890
---
llvm/CMakeLists.txt | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 60e1f29620af..d91338532815 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -693,6 +693,11 @@ option(LLVM_BUILD_TESTS
"Build LLVM unit tests. If OFF, just generate build targets." OFF)
option(LLVM_INCLUDE_TESTS "Generate build targets for the LLVM unit tests." ON)
+option(LLVM_INSTALL_GTEST
+ "Install the llvm gtest library. This should be on if you want to do
+ stand-alone builds of the other projects and run their unit tests." OFF)
+
+
option(LLVM_BUILD_BENCHMARKS "Add LLVM benchmark targets to the list of default
targets. If OFF, benchmarks still could be built using Benchmarks target." OFF)
option(LLVM_INCLUDE_BENCHMARKS "Generate benchmark targets. If OFF, benchmarks can't be built." ON)
--
2.34.3

View File

@ -0,0 +1,47 @@
From 8cc3870f09d728d9017c72eba9520117a4283fee Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Thu, 17 Nov 2022 09:01:10 +0000
Subject: Add install targets for gtest
Stand-alone builds need an installed version of gtest in order to run
the unittests.
Differential Revision: https://reviews.llvm.org/D137890
---
third-party/unittest/CMakeLists.txt | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/third-party/unittest/CMakeLists.txt b/third-party/unittest/CMakeLists.txt
index 0e54e0e57c35..1d2a52730d7d 100644
--- a/third-party/unittest/CMakeLists.txt
+++ b/third-party/unittest/CMakeLists.txt
@@ -65,12 +65,25 @@ if (NOT LLVM_ENABLE_THREADS)
endif ()
target_include_directories(llvm_gtest
- PUBLIC googletest/include googlemock/include
+ PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/googletest/include>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/googlemock/include>
+ $<INSTALL_INTERFACE:include/llvm-gtest/>
+ $<INSTALL_INTERFACE:include/llvm-gmock/>
PRIVATE googletest googlemock
)
add_subdirectory(UnitTestMain)
+if (LLVM_INSTALL_GTEST)
+export(TARGETS llvm_gtest llvm_gtest_main LLVMTestingSupport FILE LLVMGTestConfig.cmake)
+install(TARGETS llvm_gtest llvm_gtest_main LLVMTestingSupport EXPORT LLVMGTestConfig
+ ARCHIVE DESTINATION "lib${LLVM_LIBDIR_SUFFIX}" COMPONENT llvm_gtest)
+ install(EXPORT LLVMGTestConfig DESTINATION ${LLVM_INSTALL_PACKAGE_DIR} COMPONENT llvm_gtest)
+ add_llvm_install_targets(install-llvm_gtest COMPONENT llvm_gtest DEPENDS llvm_gtest LLVMGTestConfig.cmake)
+ install(DIRECTORY googletest/include/gtest/ DESTINATION include/llvm-gtest/gtest/ COMPONENT llvm_gtest)
+ install(DIRECTORY googlemock/include/gmock/ DESTINATION include/llvm-gmock/gmock/ COMPONENT llvm_gtest)
+endif()
+
# When LLVM_LINK_LLVM_DYLIB is enabled, libLLVM.so is added to the interface
# link libraries for gtest and gtest_main. This means that any target, like
# unittests for example, that links against gtest will be forced to link
--
2.34.3

46
D156379.diff Normal file
View File

@ -0,0 +1,46 @@
diff --git a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
--- a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
@@ -1152,6 +1152,11 @@
}
}
+ // Type legalization (via getNumberOfParts) can't handle structs
+ if (TLI->getValueType(DL, Src, true) == MVT::Other)
+ return BaseT::getMemoryOpCost(Opcode, Src, Alignment, AddressSpace,
+ CostKind);
+
unsigned NumOps =
(Src->isVectorTy() ? getNumVectorRegs(Src) : getNumberOfParts(Src));
diff --git a/llvm/test/Analysis/CostModel/SystemZ/struct-cost-crash.ll b/llvm/test/Analysis/CostModel/SystemZ/struct-cost-crash.ll
new file mode 100644
--- /dev/null
+++ b/llvm/test/Analysis/CostModel/SystemZ/struct-cost-crash.ll
@@ -0,0 +1,25 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 2
+; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output < %s | FileCheck %s
+;
+; Check that SystemZTTIImpl::getMemoryOpCost doesn't try to legalize structs,
+; which was failing llvm_unreachable in MVT::getVT.
+
+target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"
+target triple = "s390x-unknown-linux-gnu"
+
+declare { i64, i32 } @bar()
+
+define i8 @foo() {
+; CHECK-LABEL: 'foo'
+; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %1
+; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = call { i64, i32 } @bar()
+; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store { i64, i32 } %2, ptr inttoptr (i64 16 to ptr), align 16
+; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %1
+;
+ br label %1
+
+1: ; preds = %1, %0
+ %2 = call { i64, i32 } @bar()
+ store { i64, i32 } %2, ptr inttoptr (i64 16 to ptr), align 16
+ br label %1
+}

19
gating.yaml Normal file
View File

@ -0,0 +1,19 @@
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_testing
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier0.functional}
- !PassingTestCaseRule {test_case_name: osci.brew-build.rebuild.validation}

BIN
llvm-14.0.0.src.tar.xz.sig Normal file

Binary file not shown.

9
llvm-Config-config.h Normal file
View File

@ -0,0 +1,9 @@
#include <bits/wordsize.h>
#if __WORDSIZE == 32
#include "config-32.h"
#elif __WORDSIZE == 64
#include "config-64.h"
#else
#error "Unknown word size"
#endif

View File

@ -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

2
llvm.rpmlintrc Normal file
View File

@ -0,0 +1,2 @@
# This library has no dependencies.
addFilter("llvm-libs.x86_64: E: shared-lib-without-dependency-information /usr/lib64/libRemarks.so.[0-9]+")

View File

@ -13,12 +13,14 @@
%bcond_with compat_build
%bcond_without check
#global rc_ver 3
%global maj_ver 15
#global rc_ver 4
%global maj_ver 16
%global min_ver 0
%global patch_ver 7
%global patch_ver 6
%global llvm_srcdir llvm-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:rc%{rc_ver}}.src
%global cmake_srcdir cmake-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:rc%{rc_ver}}.src
%global third_party_srcdir third-party-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:rc%{rc_ver}}.src
%global _lto_cflags -flto=thin
%if %{with compat_build}
%global pkg_name llvm%{maj_ver}
@ -40,6 +42,14 @@
%global exec_suffix %{nil}
%endif
%if 0%{?rhel}
%global targets_to_build "X86;AMDGPU;PowerPC;NVPTX;SystemZ;AArch64;ARM;Mips;BPF;WebAssembly"
%global experimental_targets_to_build ""
%else
%global targets_to_build "all"
%global experimental_targets_to_build "AVR"
%endif
%global build_install_prefix %{buildroot}%{install_prefix}
# Lower memory usage of dwz on s390x
@ -91,26 +101,35 @@
Name: %{pkg_name}
Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}}
Release: 1%{?dist}
Release: 3%{?dist}
Summary: The Low Level Virtual Machine
License: NCSA
License: Apache-2.0 WITH LLVM-exception OR NCSA
URL: http://llvm.org
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{llvm_srcdir}.tar.xz
Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{llvm_srcdir}.tar.xz.sig
Source2: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{cmake_srcdir}.tar.xz
Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{cmake_srcdir}.tar.xz.sig
Source4: release-keys.asc
Source4: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{third_party_srcdir}.tar.xz
Source5: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{third_party_srcdir}.tar.xz.sig
Source6: release-keys.asc
%if %{without compat_build}
Source5: run-lit-tests
Source6: lit.fedora.cfg.py
Source7: run-lit-tests
Source8: lit.fedora.cfg.py
%endif
Patch2: 0001-XFAIL-missing-abstract-variable.ll-test-on-ppc64le.patch
# RHEL-specific patches.
Patch101: 0001-Deactivate-markdown-doc.patch
# Backported from LLVM 17
Patch1: 0001-SystemZ-Improve-error-messages-for-unsupported-reloc.patch
# See https://reviews.llvm.org/D137890 for the next two patches
Patch2: 0001-llvm-Add-install-targets-for-gtest.patch
# Backport of https://reviews.llvm.org/D156379 from LLVM 18.
Patch3: D156379.diff
# Patching third-party dir with a 200 offset in patch number
Patch201: 0201-third-party-Add-install-targets-for-gtest.patch
BuildRequires: gcc
BuildRequires: gcc-c++
@ -249,14 +268,21 @@ This is the main package for llvm-toolset.
%endif
%prep
%{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
%{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE3}' --data='%{SOURCE2}'
%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE3}' --data='%{SOURCE2}'
%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE5}' --data='%{SOURCE4}'
%setup -T -q -b 2 -n %{cmake_srcdir}
# TODO: It would be more elegant to set -DLLVM_COMMON_CMAKE_UTILS=%{_builddir}/%{cmake_srcdir},
# but this is not a CACHED variable, so we can't actually set it externally :(
cd ..
mv %{cmake_srcdir} cmake
%autosetup -n %{llvm_srcdir} -p2
%setup -T -q -b 4 -n %{third_party_srcdir}
%autopatch -m200 -p2
cd ..
mv %{third_party_srcdir} third-party
%setup -T -q -b 0 -n %{llvm_srcdir}
%autopatch -M200 -p2
%py3_shebang_fix \
test/BugPoint/compile-custom.ll.py \
@ -283,6 +309,9 @@ find -name '*.md' | while read md; do sed -r -e 's/^( )*\* /\n\1\* /' ${md} | pa
%global optflags %(echo %{optflags} | sed 's/-g /-g1 /')
%endif
# Copy CFLAGS into ASMFLAGS, so -fcf-protection is used when compiling assembly files.
export ASMFLAGS=$CFLAGS
# force off shared libs as cmake macros turns it on.
%cmake -G Ninja \
-DBUILD_SHARED_LIBS:BOOL=OFF \
@ -319,6 +348,7 @@ find -name '*.md' | while read md; do sed -r -e 's/^( )*\* /\n\1\* /' ${md} | pa
\
-DLLVM_INCLUDE_TESTS:BOOL=ON \
-DLLVM_BUILD_TESTS:BOOL=ON \
-DLLVM_INSTALL_GTEST:BOOL=ON \
-DLLVM_LIT_ARGS=-v \
\
-DLLVM_INCLUDE_EXAMPLES:BOOL=ON \
@ -341,11 +371,11 @@ find -name '*.md' | while read md; do sed -r -e 's/^( )*\* /\n\1\* /' ${md} | pa
%if %{without compat_build}
-DLLVM_VERSION_SUFFIX='' \
%endif
-DLLVM_UNREACHABLE_OPTIMIZE:BOOL=OFF \
-DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
-DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL=ON \
-DLLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=OFF \
\
-DLLVM_DEFAULT_TARGET_TRIPLE=%{llvm_triple} \
-DSPHINX_WARNINGS_AS_ERRORS=OFF \
-DCMAKE_INSTALL_PREFIX=%{install_prefix} \
@ -390,13 +420,14 @@ rm -rf test/tools/UpdateTestChecks
%endif
install %{build_libdir}/libLLVMTestingSupport.a %{buildroot}%{_libdir}
install %{build_libdir}/libLLVMTestingAnnotations.a %{buildroot}%{_libdir}
%global install_srcdir %{buildroot}%{_datadir}/llvm/src
# 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/
cp -R ../third-party/unittest %{install_srcdir}/utils/
# Clang needs these for running lit tests.
cp utils/update_cc_test_checks.py %{install_srcdir}/utils/
@ -469,7 +500,7 @@ rm %{buildroot}%{_bindir}/llvm-config%{exec_suffix}
touch %{buildroot}%{_bindir}/llvm-config%{exec_suffix}
%if %{without compat_build}
cp -Rv ../cmake/Modules/* %{buildroot}%{_libdir}/cmake/llvm
cp -Rv ../cmake/Modules/* %{buildroot}%{pkg_libdir}/cmake/llvm
%endif
@ -586,6 +617,7 @@ fi
%if %{without compat_build}
%{_libdir}/*.a
%exclude %{_libdir}/libLLVMTestingSupport.a
%exclude %{_libdir}/libLLVMTestingAnnotations.a
%else
%{_libdir}/%{name}/lib/*.a
%endif
@ -605,6 +637,9 @@ fi
%license LICENSE.TXT
%{_datadir}/llvm/src/utils
%{_libdir}/libLLVMTestingSupport.a
%{_libdir}/libLLVMTestingAnnotations.a
%{_includedir}/llvm-gtest
%{_includedir}/llvm-gmock
%if 0%{?rhel}
%files toolset
@ -614,6 +649,19 @@ fi
%endif
%changelog
* Thu Aug 03 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.6-3
- Fix rhbz #2228944
* Wed Jul 19 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.6-2
- Improve error messages for unsupported relocs on s390x (rhbz#2216906)
- Disable LLVM_UNREACHABLE_OPTIMIZE
* Sat Jun 17 2023 Tom Stellard <tstellar@redhat.com> - 16.0.6-1
- 16.0.6 Release
* Wed Apr 05 2023 Timm Bäder <tbaeder@redhat.com> - 16.0.0-1
- 16.0.0 Release
* Thu Jan 19 2023 Tom Stellard <tstellar@redhat.com> - 15.0.7-1
- 15.0.7 Release

7
sources Normal file
View File

@ -0,0 +1,7 @@
SHA512 (llvm-16.0.6.src.tar.xz) = 8d4cdadc9a1ad249fbf9248c8e56f3bcafab73a473a0b0ca73499ed8825c62e27668aac4f1d03341631e5ad93701621e834e9e196ca32eac3ef805cf1c860083
SHA512 (llvm-16.0.6.src.tar.xz.sig) = 9adda28085f4a2e2a64dab1d8e4ff23c5629bbb0bb6b34afc081e44f6f85ac4f3c6cd0c3488af98c0fad939c33f9d2a8a0cbef67a577cd7fe3013bc2200452b1
SHA512 (cmake-16.0.6.src.tar.xz) = 52ecd941d2d85a5b668caa5d0d40480cb6a97b3bf1174e634c2a93e9ef6d03670ca7e96abb0a60cb33ba537b93d5788754dab1f2f45c1f623f788162717d088b
SHA512 (cmake-16.0.6.src.tar.xz.sig) = d20c5e51315aa476775e6ce886684b9f882ce283fc40aa6c1b8f03964c77a1e745e2e1fb00b3488dddfe1a04378e2bfd090350de28e58088525a5305ecb1bea6
SHA512 (third-party-16.0.6.src.tar.xz) = 51683e92953eb57ed36ebc8a43cb688863edf4f24ba71965d57016cfdc17bad10f8f3942e9597a729329f89489597e79bb4653445ff1ec36ec03077adb1dd7b9
SHA512 (third-party-16.0.6.src.tar.xz.sig) = aefb22ee35b2299e77669d72557079630fba5df2c0031c72a025082de3c4ca56ea0e1ec870c42d9056752195ad0e5b68258b548caf801ef4269e2ec1cd9da513
SHA512 (release-keys.asc) = 08eab15cd40116bb1eea5ddcdd2822d248d6d7f5dce37868aa7152377aa0062567fe571909a1c9d3c3f8978ebcf5e0f6b0ab8fff13e3578c0548e21be3026462

50
tests/build-gating.fmf Normal file
View File

@ -0,0 +1,50 @@
#
# Build/PR gating tests for *LLVM 13*
#
# Imports and runs tests provided by Fedora LLVM git for the matching LLVM version.
#
# NOTE: *always* keep this file in sync with upstream, i.e. Fedora. Since we cannot "discover" a plan,
# we must duplicate at least some part of upstream plan setup, like `adjust` or `provision`. Not necessarily
# all steps, btu if we do need some of them here, let's focus on making changes in upstream first, to preserve
# one source of truth. Once TMT learns to include whole plans, we could drop the copied content from here.
#
summary: LLVM tests for build/PR gating
adjust:
- because: "Plan to be ran when either executed locally, or executed by CI system to gate a build or PR."
when: >-
trigger is defined
and trigger != commit
and trigger != build
enabled: false
# Unfortunatelly, TMT does not support more declarative approach, we need to run commands on our own.
- because: "On RHEL, CRB must be enabled to provide rarer packages"
when: >-
distro == rhel-9
or distro == rhel-8
prepare+:
- name: Enable CRB
how: shell
script: dnf config-manager --set-enabled rhel-CRB
- because: "On RHEL, CRB must be enabled to provide rarer packages"
when: >-
distro == centos
prepare+:
- name: Enable CRB
how: shell
script: dnf config-manager --set-enabled crb
discover:
- name: "Upstream LLVM tests for build/PR gating"
how: fmf
url: https://src.fedoraproject.org/rpms/llvm.git
ref: rawhide
execute:
how: tmt
provision:
hardware:
memory: ">= 4 GiB"

BIN
tstellar-gpg-key.asc Normal file

Binary file not shown.