commit 75db5a6a9f6e6347ae5722209101753510b60e6c Author: James Antill Date: Mon Aug 8 12:40:09 2022 -0400 Import rpm: 3f853a2e9c3022c51ff01d893425bd06c0c68305 diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d574d46 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +SOURCES/llvm-14.0.0.src.tar.xz +SOURCES/tstellar-gpg-key.asc diff --git a/0001-Deactivate-markdown-doc.patch b/0001-Deactivate-markdown-doc.patch new file mode 100644 index 0000000..92e048d --- /dev/null +++ b/0001-Deactivate-markdown-doc.patch @@ -0,0 +1,25 @@ +diff -Naur a/llvm/docs/conf.py b/llvm/docs/conf.py +--- a/llvm/docs/conf.py 2020-09-15 09:12:24.318287611 +0000 ++++ b/llvm/docs/conf.py 2020-09-15 15:01:00.025893199 +0000 +@@ -36,20 +36,7 @@ + '.rst': 'restructuredtext', + } + +-try: +- import recommonmark +-except ImportError: +- # manpages do not use any .md sources +- if not tags.has('builder-man'): +- raise +-else: +- import sphinx +- if sphinx.version_info >= (3, 0): +- # This requires 0.5 or later. +- extensions.append('recommonmark') +- else: +- source_parsers = {'.md': 'recommonmark.parser.CommonMarkParser'} +- source_suffix['.md'] = 'markdown' ++import sphinx + + # The encoding of source files. + #source_encoding = 'utf-8-sig' diff --git a/0001-Disable-CrashRecoveryTest.DumpStackCleanup-test-on-a.patch b/0001-Disable-CrashRecoveryTest.DumpStackCleanup-test-on-a.patch new file mode 100644 index 0000000..1ddfb0c --- /dev/null +++ b/0001-Disable-CrashRecoveryTest.DumpStackCleanup-test-on-a.patch @@ -0,0 +1,35 @@ +From 3df079ae29426b4bee3ca11681a41958d72b983a Mon Sep 17 00:00:00 2001 +From: Nikita Popov +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 + + diff --git a/0001-XFAIL-missing-abstract-variable.ll-test-on-ppc64le.patch b/0001-XFAIL-missing-abstract-variable.ll-test-on-ppc64le.patch new file mode 100644 index 0000000..4c4a9cf --- /dev/null +++ b/0001-XFAIL-missing-abstract-variable.ll-test-on-ppc64le.patch @@ -0,0 +1,33 @@ +From 9320ffeda3915c8f7be744c983a3470a89107bd7 Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Tue, 14 Sep 2021 20:21:20 -0700 +Subject: [PATCH] XFAIL missing-abstract-variable.ll test on ppc64le + +It's seems the strategy with this test is to XFAIL it on all +architectures that it fails on. I wonder if we should be passing +it a specific triple? Also, from what I can tell, this tests only +runs when llvm is configured with LLVM_DEFAULT_TARGET_TRIPLE set +to a non-empty value, which is why it may not fail in every build +configuration. + +Differential Revision: https://reviews.llvm.org/D109806 +--- + llvm/test/DebugInfo/Generic/missing-abstract-variable.ll | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/llvm/test/DebugInfo/Generic/missing-abstract-variable.ll b/llvm/test/DebugInfo/Generic/missing-abstract-variable.ll +index bd0de60268b6..cc5d56b0c512 100644 +--- a/llvm/test/DebugInfo/Generic/missing-abstract-variable.ll ++++ b/llvm/test/DebugInfo/Generic/missing-abstract-variable.ll +@@ -4,7 +4,7 @@ + ; powerpc64 (and on x86_64 at at least -O2). Presumably this is a SelectionDAG + ; issue. + ; FIXME: arm64 is an alias for aarch64 on macs, apparently? +-; XFAIL: powerpc64, aarch64, arm64, hexagon, riscv ++; XFAIL: powerpc64, aarch64, arm64, hexagon, riscv, ppc64le + + ; Build from the following source with clang -O2. + +-- +2.31.1 + diff --git a/0001-cmake-Allow-shared-libraries-to-customize-the-soname.patch b/0001-cmake-Allow-shared-libraries-to-customize-the-soname.patch new file mode 100644 index 0000000..82a00f2 --- /dev/null +++ b/0001-cmake-Allow-shared-libraries-to-customize-the-soname.patch @@ -0,0 +1,75 @@ +From 3dc5722d5c7673a879f2b4680369d3ac8b6b64b6 Mon Sep 17 00:00:00 2001 +From: Tom Stellard +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 + diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..d9959d5 --- /dev/null +++ b/gating.yaml @@ -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} diff --git a/lit.fedora.cfg.py b/lit.fedora.cfg.py new file mode 100644 index 0000000..1c918b4 --- /dev/null +++ b/lit.fedora.cfg.py @@ -0,0 +1,17 @@ + +config.llvm_tools_dir = '/usr/bin' +config.llvm_shlib_dir = '%(llvm_shlib_dir)s' % lit_config.params + +if hasattr(config, 'host_triple'): + # This means we are running lit regression tests + + # Regression tests write output to this directory, so we need to be able to specify + # a temp directory when invoking lit. e.g. lit -Dllvm_obj_root=/tmp/lit + config.llvm_obj_root = "%(llvm_obj_root)s" % lit_config.params + lit_config.load_config(config, '%(llvm_test_root)s/lit.cfg.py' % lit_config.params) +else: + # This means we are running lit unit tests + + # For unit tests, llvm_obj_root is used to find the unit test binaries. + config.llvm_obj_root = '%(llvm_unittest_bindir)s' % lit_config.params + lit_config.load_config(config, '%(llvm_test_root)s/Unit/lit.cfg.py' % lit_config.params) diff --git a/llvm-14.0.0.src.tar.xz.sig b/llvm-14.0.0.src.tar.xz.sig new file mode 100644 index 0000000..923b7ee Binary files /dev/null and b/llvm-14.0.0.src.tar.xz.sig differ diff --git a/llvm-Config-config.h b/llvm-Config-config.h new file mode 100644 index 0000000..c369b45 --- /dev/null +++ b/llvm-Config-config.h @@ -0,0 +1,9 @@ +#include + +#if __WORDSIZE == 32 +#include "config-32.h" +#elif __WORDSIZE == 64 +#include "config-64.h" +#else +#error "Unknown word size" +#endif diff --git a/llvm-Config-llvm-config.h b/llvm-Config-llvm-config.h new file mode 100644 index 0000000..2fa08c9 --- /dev/null +++ b/llvm-Config-llvm-config.h @@ -0,0 +1,9 @@ +#include + +#if __WORDSIZE == 32 +#include "llvm-config-32.h" +#elif __WORDSIZE == 64 +#include "llvm-config-64.h" +#else +#error "Unknown word size" +#endif diff --git a/llvm.rpmlintrc b/llvm.rpmlintrc new file mode 100644 index 0000000..9fc0be6 --- /dev/null +++ b/llvm.rpmlintrc @@ -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]+") diff --git a/llvm.spec b/llvm.spec new file mode 100644 index 0000000..a598b71 --- /dev/null +++ b/llvm.spec @@ -0,0 +1,914 @@ +# We are building with clang for faster/lower memory LTO builds. +# See https://docs.fedoraproject.org/en-US/packaging-guidelines/#_compiler_macros +%global toolchain clang + +# Components enabled if supported by target architecture: +%define gold_arches %{ix86} x86_64 %{arm} aarch64 %{power64} s390x +%ifarch %{gold_arches} + %bcond_without gold +%else + %bcond_with gold +%endif + +%bcond_with compat_build +%bcond_without check + +%global llvm_libdir %{_libdir}/%{name} +%global build_llvm_libdir %{buildroot}%{llvm_libdir} +#global rc_ver 4 +%global maj_ver 14 +%global min_ver 0 +%global patch_ver 0 +%if !%{maj_ver} && 0%{?rc_ver} +%global abi_revision 2 +%endif +%global llvm_srcdir llvm-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:rc%{rc_ver}}.src + +%if %{with compat_build} +%global pkg_name llvm%{maj_ver} +%global exec_suffix -%{maj_ver} +%global install_prefix %{_libdir}/%{name} +%global install_bindir %{install_prefix}/bin +%global install_includedir %{install_prefix}/include +%global install_libdir %{install_prefix}/lib + +%global pkg_bindir %{install_bindir} +%global pkg_includedir %{_includedir}/%{name} +%global pkg_libdir %{install_libdir} +%else +%global pkg_name llvm +%global install_prefix /usr +%global install_libdir %{_libdir} +%global pkg_bindir %{_bindir} +%global pkg_libdir %{install_libdir} +%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 "" +%global _smp_mflags -j8 +%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 +%global _dwz_low_mem_die_limit_s390x 1 +%global _dwz_max_die_limit_s390x 1000000 + +%ifarch %{arm} +# koji overrides the _gnu variable to be gnu, which is not correct for clang, so +# we need to hard-code the correct triple here. +%global llvm_triple armv7l-redhat-linux-gnueabihf +%else +%global llvm_triple %{_host} +%endif + +%if !0%{?rhel} +# libedit-devel is a buildroot-only package in RHEL8, so we can't have a +# any run-time depencies on it. +%global use_libedit 1 +%endif + +Name: %{pkg_name} +Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}} +Release: 3%{?dist} +Summary: The Low Level Virtual Machine + +License: 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: tstellar-gpg-key.asc + +%if %{without compat_build} +Source3: run-lit-tests +Source4: lit.fedora.cfg.py +%endif + +%if 0%{?abi_revision} +Patch0: 0001-cmake-Allow-shared-libraries-to-customize-the-soname.patch +%endif +Patch2: 0001-XFAIL-missing-abstract-variable.ll-test-on-ppc64le.patch + +# RHEL-specific patches. +Patch101: 0001-Deactivate-markdown-doc.patch + +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: clang +BuildRequires: cmake +BuildRequires: ninja-build +BuildRequires: zlib-devel +BuildRequires: libffi-devel +BuildRequires: ncurses-devel +BuildRequires: python3-psutil +BuildRequires: python3-sphinx +BuildRequires: pandoc +BuildRequires: multilib-rpm-config +%if %{with gold} +BuildRequires: binutils-devel +%endif +%ifarch %{valgrind_arches} +# Enable extra functionality when run the LLVM JIT under valgrind. +BuildRequires: valgrind-devel +%endif +%if 0%{?use_libedit} +# LLVM's LineEditor library will use libedit if it is available. +BuildRequires: libedit-devel +%endif +# We need python3-devel for pathfix.py. +BuildRequires: python3-devel +BuildRequires: python3-setuptools + +# For origin certification +BuildRequires: gnupg2 + + +Requires: %{name}-libs%{?_isa} = %{version}-%{release} + +Provides: llvm(major) = %{maj_ver} + +%description +LLVM is a compiler infrastructure designed for compile-time, link-time, +runtime, and idle-time optimization of programs from arbitrary programming +languages. The compiler infrastructure includes mirror sets of programming +tools as well as libraries with equivalent functionality. + +%package devel +Summary: Libraries and header files for LLVM +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} +# The installed LLVM cmake files will add -ledit to the linker flags for any +# app that requires the libLLVMLineEditor, so we need to make sure +# libedit-devel is available. +%if 0%{?use_libedit} +Requires: libedit-devel +%endif +# The installed cmake files reference binaries from llvm-test and llvm-static. +# We tried in the past to split the cmake exports for these binaries out into +# separate files, so that llvm-devel would not need to Require these packages, +# but this caused bugs (rhbz#1773678) and forced us to carry two non-upstream +# patches. +Requires: %{name}-static%{?_isa} = %{version}-%{release} +%if %{without compat_build} +Requires: %{name}-test%{?_isa} = %{version}-%{release} +%endif + + +Requires(post): %{_sbindir}/alternatives +Requires(postun): %{_sbindir}/alternatives + +Provides: llvm-devel(major) = %{maj_ver} + +%description devel +This package contains library and header files needed to develop new native +programs that use the LLVM infrastructure. + +%package doc +Summary: Documentation for LLVM +BuildArch: noarch +Requires: %{name} = %{version}-%{release} + +%description doc +Documentation for the LLVM compiler infrastructure. + +%package libs +Summary: LLVM shared libraries + +%description libs +Shared libraries for the LLVM compiler infrastructure. + +%package static +Summary: LLVM static libraries +Conflicts: %{name}-devel < 8 + +Provides: llvm-static(major) = %{maj_ver} + +%description static +Static libraries for the LLVM compiler infrastructure. + +%if %{without compat_build} + +%package test +Summary: LLVM regression tests +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} + +Provides: llvm-test(major) = %{maj_ver} + +%description test +LLVM regression tests. + +%package googletest +Summary: LLVM's modified googletest sources + +%description googletest +LLVM's modified googletest sources. + +%endif + +%prep +%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' +%autosetup -n %{llvm_srcdir} -p2 + +%py3_shebang_fix \ + test/BugPoint/compile-custom.ll.py \ + tools/opt-viewer/*.py \ + utils/update_cc_test_checks.py + +# Convert markdown files to rst to cope with the absence of compatible md parser in rhel. +# The sed expression takes care of a slight difference between pandoc markdown and sphinx markdown. +find -name '*.md' | while read md; do sed -r -e 's/^( )*\* /\n\1\* /' ${md} | pandoc -f markdown -o ${md%.md}.rst ; done + +%build + +mkdir -p %{_vpath_builddir} +cd %{_vpath_builddir} + +%ifarch s390 s390x +# Fails with "exceeded PCRE's backtracking limit" +%global _lto_cflags %nil +%else +%global _lto_cflags -flto=thin +%endif + +%ifarch s390 s390x %{arm} %ix86 +# Decrease debuginfo verbosity to reduce memory consumption during final library linking +%global optflags %(echo %{optflags} | sed 's/-g /-g1 /') +%endif + +# Need to explicitly call set_build_flags if we want to update LDFLAGS +%set_build_flags +export LDFLAGS="${LDFLAGS} -Wl,--build-id=md5" + +# force off shared libs as cmake macros turns it on. +%cmake .. -G Ninja \ + -DBUILD_SHARED_LIBS:BOOL=OFF \ + -DLLVM_PARALLEL_LINK_JOBS=1 \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_SKIP_RPATH:BOOL=ON \ +%ifarch s390 %{arm} %ix86 + -DCMAKE_C_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \ + -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \ +%endif +%if %{without compat_build} +%if 0%{?__isa_bits} == 64 + -DLLVM_LIBDIR_SUFFIX=64 \ +%else + -DLLVM_LIBDIR_SUFFIX= \ +%endif +%endif + \ + -DLLVM_TARGETS_TO_BUILD=%{targets_to_build} \ + -DLLVM_ENABLE_LIBCXX:BOOL=OFF \ + -DLLVM_ENABLE_ZLIB:BOOL=ON \ + -DLLVM_ENABLE_FFI:BOOL=ON \ + -DLLVM_ENABLE_RTTI:BOOL=ON \ + -DLLVM_USE_PERF:BOOL=ON \ +%if %{with gold} + -DLLVM_BINUTILS_INCDIR=%{_includedir} \ +%endif + -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=%{experimental_targets_to_build} \ + \ + -DLLVM_BUILD_RUNTIME:BOOL=ON \ + \ + -DLLVM_INCLUDE_TOOLS:BOOL=ON \ + -DLLVM_BUILD_TOOLS:BOOL=ON \ + \ + -DLLVM_INCLUDE_TESTS:BOOL=ON \ + -DLLVM_BUILD_TESTS:BOOL=ON \ + -DLLVM_LIT_ARGS=-v \ + \ + -DLLVM_INCLUDE_EXAMPLES:BOOL=ON \ + -DLLVM_BUILD_EXAMPLES:BOOL=OFF \ + \ + -DLLVM_INCLUDE_UTILS:BOOL=ON \ +%if %{with compat_build} + -DLLVM_INSTALL_UTILS:BOOL=OFF \ +%else + -DLLVM_INSTALL_UTILS:BOOL=ON \ + -DLLVM_UTILS_INSTALL_DIR:PATH=%{_bindir} \ + -DLLVM_TOOLS_INSTALL_DIR:PATH=bin \ +%endif + \ + -DLLVM_INCLUDE_DOCS:BOOL=ON \ + -DLLVM_BUILD_DOCS:BOOL=ON \ + -DLLVM_ENABLE_SPHINX:BOOL=ON \ + -DLLVM_ENABLE_DOXYGEN:BOOL=OFF \ + \ +%if %{without compat_build} + -DLLVM_VERSION_SUFFIX='' \ +%endif + -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 \ + %{?abi_revision:-DLLVM_ABI_REVISION=%{abi_revision}} \ + \ + -DLLVM_DEFAULT_TARGET_TRIPLE=%{llvm_triple} \ + -DSPHINX_WARNINGS_AS_ERRORS=OFF \ + -DCMAKE_INSTALL_PREFIX=%{install_prefix} \ + -DLLVM_INSTALL_SPHINX_HTML_DIR=%{_pkgdocdir}/html \ + -DSPHINX_EXECUTABLE=%{_bindir}/sphinx-build-3 \ + -DLLVM_INCLUDE_BENCHMARKS=OFF + +# Build libLLVM.so first. This ensures that when libLLVM.so is linking, there +# are no other compile jobs running. This will help reduce OOM errors on the +# builders without having to artificially limit the number of concurrent jobs. +%ninja_build LLVM +%ninja_build + +%install +%ninja_install -C %{_vpath_builddir} + +mkdir -p %{buildroot}/%{_bindir} + +%if %{without compat_build} + +# Fix some man pages +ln -s llvm-config.1 %{buildroot}%{_mandir}/man1/llvm-config%{exec_suffix}-%{__isa_bits}.1 + +# Install binaries needed for lit tests +%global test_binaries llvm-isel-fuzzer llvm-opt-fuzzer + +for f in %{test_binaries} +do + install -m 0755 %{_vpath_builddir}/bin/$f %{buildroot}%{_bindir} +done + +# Remove testing of update utility tools +rm -rf test/tools/UpdateTestChecks + +%multilib_fix_c_header --file %{_includedir}/llvm/Config/llvm-config.h + +# Install libraries needed for unittests +%if 0%{?__isa_bits} == 64 +%global build_libdir %{_vpath_builddir}/lib64 +%else +%global build_libdir %{_vpath_builddir}/lib +%endif + +install %{build_libdir}/libLLVMTestingSupport.a %{buildroot}%{_libdir} + +%global install_srcdir %{buildroot}%{_datadir}/llvm/src +%global lit_cfg test/%{_arch}.site.cfg.py +%global lit_unit_cfg test/Unit/%{_arch}.site.cfg.py +%global lit_fedora_cfg %{_datadir}/llvm/lit.fedora.cfg.py + +# 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/ + +# Clang needs these for running lit tests. +cp utils/update_cc_test_checks.py %{install_srcdir}/utils/ +cp -R utils/UpdateTestChecks %{install_srcdir}/utils/ + +%if %{with gold} +# Add symlink to lto plugin in the binutils plugin directory. +%{__mkdir_p} %{buildroot}%{_libdir}/bfd-plugins/ +ln -s %{_libdir}/LLVMgold.so %{buildroot}%{_libdir}/bfd-plugins/ +%endif + +%else + +# Add version suffix to binaries +for f in %{buildroot}/%{install_bindir}/*; do + filename=`basename $f` + ln -s ../../../%{install_bindir}/$filename %{buildroot}/%{_bindir}/$filename%{exec_suffix} +done + +# Move header files +mkdir -p %{buildroot}/%{pkg_includedir} +ln -s ../../../%{install_includedir}/llvm %{buildroot}/%{pkg_includedir}/llvm +ln -s ../../../%{install_includedir}/llvm-c %{buildroot}/%{pkg_includedir}/llvm-c + +# Fix multi-lib +%multilib_fix_c_header --file %{install_includedir}/llvm/Config/llvm-config.h + +# Create ld.so.conf.d entry +mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d +cat >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf << EOF +%{pkg_libdir} +EOF + +# Add version suffix to man pages and move them to mandir. +mkdir -p %{buildroot}/%{_mandir}/man1 +for f in %{build_install_prefix}/share/man/man1/*; do + filename=`basename $f | cut -f 1 -d '.'` + mv $f %{buildroot}%{_mandir}/man1/$filename%{exec_suffix}.1 +done + +# Remove opt-viewer, since this is just a compatibility package. +rm -Rf %{build_install_prefix}/share/opt-viewer + +%endif + +# llvm-config special casing. llvm-config is managed by update-alternatives. +# the original file must remain available for compatibility with the CMake +# infrastructure. Without compat, cmake points to the symlink, with compat it +# points to the original file. + +%if %{without compat_build} + +mv %{buildroot}/%{pkg_bindir}/llvm-config %{buildroot}/%{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} +# We still maintain a versionned symlink for consistency across llvm versions. +# This is specific to the non-compat build and matches the exec prefix for +# compat builds. An isa-agnostic versionned symlink is also maintained in the (un)install +# steps. +(cd %{buildroot}/%{pkg_bindir} ; ln -s llvm-config%{exec_suffix}-%{__isa_bits} llvm-config-%{maj_ver}-%{__isa_bits} ) +# ghost presence +touch %{buildroot}%{_bindir}/llvm-config-%{maj_ver} + +%else + +rm %{buildroot}%{_bindir}/llvm-config%{exec_suffix} +(cd %{buildroot}/%{pkg_bindir} ; ln -s llvm-config llvm-config%{exec_suffix}-%{__isa_bits} ) + +%endif + +# ghost presence +touch %{buildroot}%{_bindir}/llvm-config%{exec_suffix} + +%if %{without compat_build} +cp -Rv ../cmake/Modules/* %{buildroot}%{_libdir}/cmake/llvm +%endif + + +%check +# Disable check section on arm due to some kind of memory related failure. +# Possibly related to https://bugzilla.redhat.com/show_bug.cgi?id=1920183 +%ifnarch %{arm} + +# TODO: Fix the failures below +%ifarch %{arm} +rm test/tools/llvm-readobj/ELF/dependent-libraries.test +%endif + +# non reproducible errors +rm test/tools/dsymutil/X86/swift-interface.test + +%if %{with check} +# FIXME: use %%cmake_build instead of %%__ninja +LD_LIBRARY_PATH=%{buildroot}/%{pkg_libdir} %{__ninja} check-all -C %{_vpath_builddir} +%endif + +%endif + +%ldconfig_scriptlets libs + +%post devel +%{_sbindir}/update-alternatives --install %{_bindir}/llvm-config%{exec_suffix} llvm-config%{exec_suffix} %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{__isa_bits} +%if %{without compat_build} +%{_sbindir}/update-alternatives --install %{_bindir}/llvm-config-%{maj_ver} llvm-config-%{maj_ver} %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{__isa_bits} +%endif + +%postun devel +if [ $1 -eq 0 ]; then + %{_sbindir}/update-alternatives --remove llvm-config%{exec_suffix} %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} +%if %{without compat_build} + %{_sbindir}/update-alternatives --remove llvm-config-%{maj_ver} %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} +%endif +fi + +%files +%license LICENSE.TXT +%exclude %{_mandir}/man1/llvm-config* +%{_mandir}/man1/* +%{_bindir}/* + +%exclude %{_bindir}/llvm-config%{exec_suffix} +%exclude %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} + +%if %{without compat_build} +%exclude %{_bindir}/llvm-config-%{maj_ver} +%exclude %{pkg_bindir}/llvm-config-%{maj_ver}-%{__isa_bits} +%exclude %{_bindir}/not +%exclude %{_bindir}/count +%exclude %{_bindir}/yaml-bench +%exclude %{_bindir}/lli-child-target +%exclude %{_bindir}/llvm-isel-fuzzer +%exclude %{_bindir}/llvm-opt-fuzzer +%{_datadir}/opt-viewer +%else +%{pkg_bindir} +%endif + +%files libs +%license LICENSE.TXT +%{pkg_libdir}/libLLVM-%{maj_ver}.so +%if %{without compat_build} +%if %{with gold} +%{_libdir}/LLVMgold.so +%{_libdir}/bfd-plugins/LLVMgold.so +%endif +%{_libdir}/libLLVM-%{maj_ver}.%{min_ver}*.so +%{_libdir}/libLLVM-%{maj_ver}.so%{?abi_revision:.%{abi_revision}} +%{_libdir}/libLTO.so* +%else +%config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf +%if %{with gold} +%{_libdir}/%{name}/lib/LLVMgold.so +%endif +%{pkg_libdir}/libLLVM-%{maj_ver}.%{min_ver}*.so +%{pkg_libdir}/libLTO.so* +%exclude %{pkg_libdir}/libLTO.so +%endif +%{pkg_libdir}/libRemarks.so* + +%files devel +%license LICENSE.TXT + +%ghost %{_bindir}/llvm-config%{exec_suffix} +%{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} +%{_mandir}/man1/llvm-config* + +%if %{without compat_build} +%{_includedir}/llvm +%{_includedir}/llvm-c +%{_libdir}/libLLVM.so +%{_libdir}/cmake/llvm +%{pkg_bindir}/llvm-config-%{maj_ver}-%{__isa_bits} +%ghost %{_bindir}/llvm-config-%{maj_ver} +%else +%{install_includedir}/llvm +%{install_includedir}/llvm-c +%{pkg_includedir}/llvm +%{pkg_includedir}/llvm-c +%{pkg_libdir}/libLTO.so +%{pkg_libdir}/libLLVM.so +%{pkg_libdir}/cmake/llvm +%endif + +%files doc +%license LICENSE.TXT +%doc %{_pkgdocdir}/html + +%files static +%license LICENSE.TXT +%if %{without compat_build} +%{_libdir}/*.a +%exclude %{_libdir}/libLLVMTestingSupport.a +%else +%{_libdir}/%{name}/lib/*.a +%endif + +%if %{without compat_build} + +%files test +%license LICENSE.TXT +%{_bindir}/not +%{_bindir}/count +%{_bindir}/yaml-bench +%{_bindir}/lli-child-target +%{_bindir}/llvm-isel-fuzzer +%{_bindir}/llvm-opt-fuzzer + +%files googletest +%license LICENSE.TXT +%{_datadir}/llvm/src/utils +%{_libdir}/libLLVMTestingSupport.a + +%endif + +%changelog +* Mon May 23 2022 Timm Bäder - 14.0.0-3 +- Build gold plugin on s390x as well + +* Fri Apr 29 2022 Timm Bäder - 14.0.0-2 +- Remove llvm-cmake-devel package again + +* Thu Apr 07 2022 Timm Bäder - 14.0.0-1 +- Update to 14.0.0 + +* Wed Feb 02 2022 Tom Stellard - 13.0.1-1 +- 13.0.1 Release + +* Sat Jan 29 2022 Tom Stellard - 13.0.0-4 +- Rebuild with gcc fix from rhbz#2028609 + +* Thu Oct 21 2021 sguelton@redhat.com - 13.0.0-3 +- Correctly set ldflags + +* Wed Oct 20 2021 Tom Stellard - 13.0.0-2 +- Disable failing test on s390x + +* Thu Oct 14 2021 Tom Stellard - 13.0.0-1 +- 13.0.0 Release + +* Fri Jul 16 2021 sguelton@redhat.com - 12.0.1-1 +- 12.0.1 release + +* Fri Jul 02 2021 Tom Stellard - 12.0.0-2 +- Stop installing lit tests + +* Tue May 25 2021 sguelton@redhat.com - 12.0.0-1 +- Remove obsolete patch + +* Thu Oct 29 2020 sguelton@redhat.com - 11.0.0-2 +- Remove obsolete patch + +* Wed Sep 30 2020 sguelton@redhat.com - 11.0.0-1 +- 11.0.1 final release + +* Wed Sep 30 2020 sguelton@redhat.com - 11.0.0-0.6.rc2 +- Restore default CI behavior wrt. number of threads + +* Fri Sep 25 2020 sguelton@redhat.com - 11.0.0-0.5.rc2 +- Fix test case depending on fs capability + +* Fri Sep 25 2020 sguelton@redhat.com - 11.0.0-0.4.rc2 +- Fix dependency on dsymutil.rst from CI + +* Thu Sep 24 2020 sguelton@redhat.com - 11.0.0-0.3.rc2 +- Fix test file generation + +* Wed Sep 23 2020 sguelton@redhat.com - 11.0.0-0.2.rc2 +- Remove runtime dep on libedit-devel + +* Mon Sep 14 2020 sguelton@redhat.com - 11.0.0-0.1.rc2 +- 11.0.1.rc2 Release + +* Wed Aug 19 2020 Tom Stellard - 10.0.1-3 +- Fix rust crash on ppc64le compiling firefox + +* Fri Jul 31 2020 sguelton@redhat.com - 10.0.1-2 +- Fix llvm-config alternative handling, see rhbz#1859996 + +* Fri Jul 24 2020 sguelton@redhat.com - 10.0.1-1 +- 10.0.1 Release + +* Wed Jun 24 2020 sguelton@redhat.com - 10.0.0-2 +- Reproducible build of test.tar.gz, see rhbz#1820319 + +* Tue Apr 7 2020 sguelton@redhat.com - 10.0.0-1 +- 10.0.0 Release + +* Thu Feb 27 2020 Josh Stone - 9.0.1-4 +- Fix a codegen bug for Rust + +* Fri Jan 17 2020 Tom Stellard - 9.0.1-3 +- Add explicit Requires from sub-packages to llvm-libs + +* Fri Jan 10 2020 Tom Stellard - 9.0.1-2 +- Fix crash with kernel bpf self-tests + +* Thu Dec 19 2019 tstellar@redhat.com - 9.0.1-1 +- 9.0.1 Release + +* Wed Oct 30 2019 Tom Stellard - 9.0.0-5 +- Remove work-around for threading issue in gold + +* Wed Oct 30 2019 Tom Stellard - 9.0.0-4 +- Build libLLVM.so first to avoid OOM errors + +* Tue Oct 01 2019 Tom Stellard - 9.0.0-3 +- Adjust run-lit-tests script to better match in tree testing + +* Mon Sep 30 2019 Tom Stellard - 9.0.0-2 +- Limit number of build threads using -l option for ninja + +* Thu Sep 26 2019 Tom Stellard - 9.0.0-1 +- 9.0.0 Release + +* Thu Aug 1 2019 sguelton@redhat.com - 8.0.1-1 +- 8.0.1 release + +* Tue Jul 2 2019 sguelton@redhat.com - 8.0.1-0.3.rc2 +- Deactivate multithreading for gold plugin only to fix rhbz#1636479 + +* Mon Jun 17 2019 sguelton@redhat.com - 8.0.1-0.2.rc2 +- Deactivate multithreading instead of patching to fix rhbz#1636479 + +* Thu Jun 13 2019 sguelton@redhat.com - 8.0.1-0.1.rc2 +- 8.0.1rc2 Release + +* Tue May 14 2019 sguelton@redhat.com - 8.0.0-3 +- Disable threading in LTO + +* Wed May 8 2019 sguelton@redhat.com - 8.0.0-2 +- Fix conflicts between llvm-static = 8 and llvm-dev < 8 around LLVMStaticExports.cmake + +* Thu May 2 2019 sguelton@redhat.com - 8.0.0-1 +- 8.0.0 Release + +* Fri Dec 14 2018 Tom Stellard - 7.0.1-1 +- 7.0.1 Release + +* Thu Dec 13 2018 Tom Stellard - 7.0.1-0.5.rc3 +- Drop compat libs + +* Wed Dec 12 2018 Tom Stellard - 7.0.1-0.4.rc3 +- Fix ambiguous python shebangs + +* Tue Dec 11 2018 Tom Stellard - 7.0.1-0.3.rc3 +- Disable threading in thinLTO + +* Tue Dec 11 2018 Tom Stellard - 7.0.1-0.2.rc3 +- Update cmake options for compat build + +* Mon Dec 10 2018 Tom Stellard - 7.0.1-0.1.rc3 +- 7.0.1-rc3 Release + +* Fri Dec 07 2018 Tom Stellard - 6.0.1-14 +- Don't build llvm-test on i686 + +* Thu Dec 06 2018 Tom Stellard - 6.0.1-13 +- Fix build when python2 is not present on system + +* Tue Nov 06 2018 Tom Stellard - 6.0.1-12 +- Fix multi-lib installation of llvm-devel + +* Tue Oct 23 2018 Tom Stellard - 6.0.1-11 +- Add sub-packages for testing + +* Mon Oct 01 2018 Tom Stellard - 6.0.1-10 +- Drop scl macros + +* Tue Aug 28 2018 Tom Stellard - 6.0.1-9 +- Drop libedit dependency + +* Tue Aug 14 2018 Tom Stellard - 6.0.1-8 +- Only enabled valgrind functionality on arches that support it + +* Mon Aug 13 2018 Tom Stellard - 6.0.1-7 +- BuildRequires: python3-devel + +* Mon Aug 06 2018 Tom Stellard - 6.0.1-6 +- Backport fixes for rhbz#1610053, rhbz#1562196, rhbz#1595996 + +* Mon Aug 06 2018 Tom Stellard - 6.0.1-5 +- Fix ld.so.conf.d path in files list + +* Sat Aug 04 2018 Tom Stellard - 6.0.1-4 +- Fix ld.so.conf.d path + +* Fri Aug 03 2018 Tom Stellard - 6.0.1-3 +- Install ld.so.conf so llvm libs are in the library search path + +* Wed Jul 25 2018 Tom Stellard - 6.0.1-2 +- Re-enable doc package now that BREW-2381 is fixed + +* Tue Jul 10 2018 Tom Stellard - 6.0.1-1 +- 6.0.1 Release + +* Mon Jun 04 2018 Tom Stellard - 5.0.1-13 +- Limit build jobs on ppc64 to avoid OOM errors + +* Sat Jun 02 2018 Tom Stellard - 5.0.1-12 +- Switch to python3-sphinx + +* Thu May 31 2018 Tom Stellard - 5.0.1-11 +- Remove conditionals to enable building only the llvm-libs package, we don't + needs these for module builds. + +* Wed May 23 2018 Tom Stellard - 5.0.1-10 +- Add BuildRequires: libstdc++-static +- Resolves: #1580785 + +* Wed Apr 04 2018 Tom Stellard - 5.0.1-9 +- Add conditionals to enable building only the llvm-libs package + +* Tue Apr 03 2018 Tom Stellard - 5.0.1-8 +- Drop BuildRequires: libstdc++-static this package does not exist in RHEL8 + +* Tue Mar 20 2018 Tilmann Scheller - 5.0.1-7 +- Backport fix for rhbz#1558226 from trunk + +* Tue Mar 06 2018 Tilmann Scheller - 5.0.1-6 +- Backport fix for rhbz#1550469 from trunk + +* Thu Feb 22 2018 Tom Stellard - 5.0.1-5 +- Backport some retpoline fixes + +* Tue Feb 06 2018 Tom Stellard - 5.0.1-4 +- Backport retpoline support + +* Mon Jan 29 2018 Tom Stellard - 5.0.1-3 +- Backport r315279 to fix an issue with rust + +* Mon Jan 15 2018 Tom Stellard - 5.0.1-2 +- Drop ExculdeArch: ppc64 + +* Mon Jan 08 2018 Tom Stellard - 5.0.1-1 +- 5.0.1 Release + +* Thu Jun 22 2017 Tom Stellard - 4.0.1-3 +- Fix Requires for devel package again. + +* Thu Jun 22 2017 Tom Stellard - 4.0.1-2 +- Fix Requires for llvm-devel + +* Tue Jun 20 2017 Tom Stellard - 4.0.1-1 +- 4.0.1 Release + +* Mon Jun 05 2017 Tom Stellard - 4.0.0-5 +- Build for llvm-toolset-7 rename + +* Mon May 01 2017 Tom Stellard - 4.0.0-4 +- Remove multi-lib workarounds + +* Fri Apr 28 2017 Tom Stellard - 4.0.0-3 +- Fix build with llvm-toolset-4 scl + +* Mon Apr 03 2017 Tom Stellard - 4.0.0-2 +- Simplify spec with rpm macros. + +* Thu Mar 23 2017 Tom Stellard - 4.0.0-1 +- LLVM 4.0.0 Final Release + +* Wed Mar 22 2017 tstellar@redhat.com - 3.9.1-6 +- Fix %%postun sep for -devel package. + +* Mon Mar 13 2017 Tom Stellard - 3.9.1-5 +- Disable failing tests on ARM. + +* Sun Mar 12 2017 Peter Robinson 3.9.1-4 +- Fix missing mask on relocation for aarch64 (rhbz 1429050) + +* Wed Mar 01 2017 Dave Airlie - 3.9.1-3 +- revert upstream radeonsi breaking change. + +* Thu Feb 23 2017 Josh Stone - 3.9.1-2 +- disable sphinx warnings-as-errors + +* Fri Feb 10 2017 Orion Poplawski - 3.9.1-1 +- llvm 3.9.1 + +* Fri Feb 10 2017 Fedora Release Engineering - 3.9.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Tue Nov 29 2016 Josh Stone - 3.9.0-7 +- Apply backports from rust-lang/llvm#55, #57 + +* Tue Nov 01 2016 Dave Airlie - 3.9.0-5 +- apply the patch from -4 + +* Wed Oct 26 2016 Dave Airlie - 3.9.0-4 +- add fix for lldb out-of-tree build + +* Mon Oct 17 2016 Josh Stone - 3.9.0-3 +- Apply backports from rust-lang/llvm#47, #48, #53, #54 + +* Sat Oct 15 2016 Josh Stone - 3.9.0-2 +- Apply an InstCombine backport via rust-lang/llvm#51 + +* Wed Sep 07 2016 Dave Airlie - 3.9.0-1 +- llvm 3.9.0 +- upstream moved where cmake files are packaged. +- upstream dropped CppBackend + +* Wed Jul 13 2016 Adam Jackson - 3.8.1-1 +- llvm 3.8.1 +- Add mips target +- Fix some shared library mispackaging + +* Tue Jun 07 2016 Jan Vcelak - 3.8.0-2 +- fix color support detection on terminal + +* Thu Mar 10 2016 Dave Airlie 3.8.0-1 +- llvm 3.8.0 release + +* Wed Mar 09 2016 Dan Horák 3.8.0-0.3 +- install back memory consumption workaround for s390 + +* Thu Mar 03 2016 Dave Airlie 3.8.0-0.2 +- llvm 3.8.0 rc3 release + +* Fri Feb 19 2016 Dave Airlie 3.8.0-0.1 +- llvm 3.8.0 rc2 release + +* Tue Feb 16 2016 Dan Horák 3.7.1-7 +- recognize s390 as SystemZ when configuring build + +* Sat Feb 13 2016 Dave Airlie 3.7.1-6 +- export C++ API for mesa. + +* Sat Feb 13 2016 Dave Airlie 3.7.1-5 +- reintroduce llvm-static, clang needs it currently. + +* Fri Feb 12 2016 Dave Airlie 3.7.1-4 +- jump back to single llvm library, the split libs aren't working very well. + +* Fri Feb 05 2016 Dave Airlie 3.7.1-3 +- add missing obsoletes (#1303497) + +* Thu Feb 04 2016 Fedora Release Engineering - 3.7.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Jan 07 2016 Jan Vcelak 3.7.1-1 +- new upstream release +- enable gold linker + +* Wed Nov 04 2015 Jan Vcelak 3.7.0-100 +- fix Requires for subpackages on the main package + +* Tue Oct 06 2015 Jan Vcelak 3.7.0-100 +- initial version using cmake build system diff --git a/run-lit-tests b/run-lit-tests new file mode 100755 index 0000000..4d8cdf5 --- /dev/null +++ b/run-lit-tests @@ -0,0 +1,59 @@ +#!/bin/bash + +usage() { + echo "usage: `basename $0` [OPTIONS]" + echo " --threads NUM The number of threads to use for running tests." + echo " --multilib-arch ARCH Use this option to test 32-bit libs/binaries on" + echo " 64-bit hosts." +} + +threads_arg='' + +while [ $# -gt 0 ]; do + case $1 in + --threads) + shift + threads_arg="--threads $1" + ;; + --multilib-arch) + shift + ARCH=$1 + ;; + * ) + echo "unknown option: $1" + echo "" + usage + exit 1 + ;; + esac + shift +done + +set -xe + +if [ -z "$ARCH" ]; then + ARCH=`rpm --eval '%_arch'` +fi + +case $ARCH in + arm) + ;& + i686) + LIB_DIR="/usr/lib/" + ;; + *) + LIB_DIR="/usr/lib64/" + ;; +esac + +cd $(mktemp -d) +ln -s /usr/include include +tar -xzf /usr/share/llvm/src/test.tar.gz +ln -s /usr/share/llvm/src/$ARCH.site.cfg.py test/lit.site.cfg.py +ln -s /usr/share/llvm/src/$ARCH.Unit.site.cfg.py test/Unit/lit.site.cfg.py +ln -s /usr/share/llvm/src/docs docs +lit -v $threads_arg test \ + -Dllvm_obj_root=`pwd` \ + -Dllvm_test_root=`pwd`/test \ + -Dllvm_unittest_bindir=$LIB_DIR/llvm \ + -Dllvm_shlib_dir=$LIB_DIR diff --git a/sources b/sources new file mode 100644 index 0000000..6e3a05e --- /dev/null +++ b/sources @@ -0,0 +1,2 @@ +SHA1 (llvm-14.0.0.src.tar.xz) = e56aad75fe66a33cb027464099c8164605693c49 +SHA1 (tstellar-gpg-key.asc) = b8d2648a01d36ed0186fd2c5af325fd28797f9a0 diff --git a/tests/build-gating.fmf b/tests/build-gating.fmf new file mode 100644 index 0000000..fd3bad7 --- /dev/null +++ b/tests/build-gating.fmf @@ -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" diff --git a/tstellar-gpg-key.asc b/tstellar-gpg-key.asc new file mode 100644 index 0000000..eba625c Binary files /dev/null and b/tstellar-gpg-key.asc differ