diff --git a/.copr/Makefile b/.copr/Makefile new file mode 100644 index 0000000..60013ce --- /dev/null +++ b/.copr/Makefile @@ -0,0 +1,33 @@ +# See https://docs.pagure.org/copr.copr/user_documentation.html#make-srpm +# See for the --setopt option in the enabling of copr repo see: +# https://pagure.io/copr/copr/issue/184 + +COPR_USERNAME=$(shell rpm --eval %copr_username) +COPR_PROJECT=$(shell rpm --eval %copr_projectname) +YYYYMMDD=$(shell date +%Y%m%d) + +required_packages=git tar xz curl fedpkg +outdir?=$(shell pwd) +spec?=llvm.spec + +.PHONY: srpm +srpm: + @echo "Check for required packages needed by snapshot-info.sh: $(required_packages)" + rpm -q $(required_packages) || dnf install -y $(required_packages) --setopt=install_weak_deps=False + + @echo "Fetch information about today's snapshot" + YYYYMMDD=$(YYYYMMDD) ./.copr/snapshot-info.sh > version.spec.inc + + @echo "Get sources" + fedpkg --release rawhide sources --outdir $(shell pwd) + + @echo "Remove left-over llvm-project tarball and signature" + rm -vf $(shell pwd)/llvm-project-*.tar.xz* + + @echo "Finally build SRPM" + rpmbuild \ + --with=snapshot_build \ + --define "_srcrpmdir $(outdir)" \ + --define "_sourcedir $(shell pwd)" \ + --define "_disable_source_fetch 0" \ + -bs $(spec) diff --git a/131801.patch b/131801.patch deleted file mode 100644 index 853fba8..0000000 --- a/131801.patch +++ /dev/null @@ -1,46 +0,0 @@ -From d25887408ee9fb78d68787ff7388cba254aced6f Mon Sep 17 00:00:00 2001 -From: Nikita Popov -Date: Tue, 18 Mar 2025 14:36:06 +0100 -Subject: [PATCH] [GlobalMerge][PPC] Don't merge globals in llvm.metadata - section - -The llvm.metadata section is not emitted and has special semantics. -We should not merge globals in it, similarly to how we already -skip merging of `llvm.xyz` globals. - -Fixes https://github.com/llvm/llvm-project/issues/131394. ---- - llvm/lib/CodeGen/GlobalMerge.cpp | 3 ++- - llvm/test/CodeGen/PowerPC/global-merge-llvm-metadata.ll | 9 +++++++++ - 2 files changed, 11 insertions(+), 1 deletion(-) - create mode 100644 llvm/test/CodeGen/PowerPC/global-merge-llvm-metadata.ll - -diff --git a/llvm/lib/CodeGen/GlobalMerge.cpp b/llvm/lib/CodeGen/GlobalMerge.cpp -index 1aedc447935b7..ca743918cec24 100644 ---- a/llvm/lib/CodeGen/GlobalMerge.cpp -+++ b/llvm/lib/CodeGen/GlobalMerge.cpp -@@ -711,7 +711,8 @@ bool GlobalMergeImpl::run(Module &M) { - continue; - - // Ignore all 'special' globals. -- if (GV.getName().starts_with("llvm.") || GV.getName().starts_with(".llvm.")) -+ if (GV.getName().starts_with("llvm.") || -+ GV.getName().starts_with(".llvm.") || Section == "llvm.metadata") - continue; - - // Ignore all "required" globals: -diff --git a/llvm/test/CodeGen/PowerPC/global-merge-llvm-metadata.ll b/llvm/test/CodeGen/PowerPC/global-merge-llvm-metadata.ll -new file mode 100644 -index 0000000000000..7db092e13afeb ---- /dev/null -+++ b/llvm/test/CodeGen/PowerPC/global-merge-llvm-metadata.ll -@@ -0,0 +1,9 @@ -+; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -+ -+@index = global i32 0, align 4 -+@.str = private unnamed_addr constant [1 x i8] zeroinitializer, section "llvm.metadata" -+@.str.1 = private unnamed_addr constant [7 x i8] c"test.c\00", section "llvm.metadata" -+@llvm.global.annotations = appending global [1 x { ptr, ptr, ptr, i32, ptr }] [{ ptr, ptr, ptr, i32, ptr } { ptr @index, ptr @.str, ptr @.str.1, i32 1, ptr null }], section "llvm.metadata" -+ -+; CHECK-NOT: .set -+; CHECK-NOT: _MergedGlobals diff --git a/20-131099.patch b/20-131099.patch new file mode 100644 index 0000000..0b66256 --- /dev/null +++ b/20-131099.patch @@ -0,0 +1,28 @@ +From e43271ec7438ecb78f99db134aeca274a47f6c28 Mon Sep 17 00:00:00 2001 +From: Konrad Kleine +Date: Thu, 13 Mar 2025 09:12:24 +0100 +Subject: [PATCH] Filter out configuration file from compile commands + +The commands to run the compilation when printed with `-###` contain +various irrelevant lines for the perf-training. Most of them are +filtered out already but when configured with +`CLANG_CONFIG_FILE_SYSTEM_DIR` a new line like the following is +added and needs to be filtered out: + +`Configuration file: /etc/clang/x86_64-redhat-linux-gnu-clang.cfg` +--- + clang/utils/perf-training/perf-helper.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/clang/utils/perf-training/perf-helper.py b/clang/utils/perf-training/perf-helper.py +index 80c6356d0497c..29904aded5ab0 100644 +--- a/clang/utils/perf-training/perf-helper.py ++++ b/clang/utils/perf-training/perf-helper.py +@@ -237,6 +237,7 @@ def get_cc1_command_for_args(cmd, env): + or ln.startswith("InstalledDir:") + or ln.startswith("LLVM Profile Note") + or ln.startswith(" (in-process)") ++ or ln.startswith("Configuration file:") + or " version " in ln + ): + continue diff --git a/Makefile b/Makefile index 902d857..242e15d 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # Tweak this to centos-stream-9-x86_64 to build for CentOS MOCK_CHROOT?=fedora-rawhide-x86_64 MOCK_OPTS?= -MOCK_OPTS_RELEASE?=--no-clean --no-cleanup-after --without lto_build --define "debug_package %{nil}" $(MOCK_OPTS) +MOCK_OPTS_RELEASE?=--no-clean --no-cleanup-after --without lto_build --without pgo --define "debug_package %{nil}" $(MOCK_OPTS) MOCK_OPTS_SNAPSHOT?=$(MOCK_OPTS_RELEASE) --with snapshot_build $(MOCK_OPTS) YYYYMMDD?=$(shell date +%Y%m%d) SOURCEDIR=$(shell pwd) @@ -103,6 +103,22 @@ edit-last-failing-script: get-last-run-script mockbuild-rerun-last-script: get-last-run-script mock --root=$(MOCK_CHROOT) --shell 'sh -e $(last_run_script)' +.PHONY: mock-shell +## Run an interactive mock shell with bash +mock-shell: + mock --root=$(MOCK_CHROOT) --shell bash + +######### Help debug inside mock environment + +.PHONY: mock-install-debugging-tools +## This will install gdb, gdb-dashboard, vim, valgrind, lldb and +## other tools into your mock environment for you to debug any +## problems. +mock-install-debugging-tools: + mock --root=$(MOCK_CHROOT) --install python3-pygments vim gdb lldb python3-rpm valgrind + curl -sLO https://github.com/cyrus-and/gdb-dashboard/raw/master/.gdbinit + mock --root=$(MOCK_CHROOT) --copyin .gdbinit /builddir/.gdbinit + .PHONY: help # Based on https://gist.github.com/rcmachado/af3db315e31383502660 ## Display this help text. diff --git a/gating.yaml b/gating.yaml index cdcc377..30b98a7 100644 --- a/gating.yaml +++ b/gating.yaml @@ -23,6 +23,7 @@ rules: --- !Policy product_versions: - rhel-9 + - rhel-10 decision_context: osci_compose_gate rules: - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier0-tmt-x86_64-aarch64.functional} diff --git a/llvm.spec b/llvm.spec index ff88cff..b828ddb 100644 --- a/llvm.spec +++ b/llvm.spec @@ -2,7 +2,7 @@ #region version %global maj_ver 20 %global min_ver 1 -%global patch_ver 3 +%global patch_ver 8 #global rc_ver 3 %bcond_with snapshot_build @@ -41,6 +41,21 @@ %bcond_without lldb +%ifarch ppc64le +%if %{defined rhel} && 0%{?rhel} < 10 && %{maj_ver} >= 21 +# RHEL <= 9 use the IBM long double format, which is not supported by libc. +# Since LLVM 21, parts of libc are required in order to build offload. +%bcond_with offload +%else +%bcond_without offload +%endif +%elifarch %{ix86} +# libomptarget is not supported on 32-bit systems. +%bcond_with offload +%else +%bcond_without offload +%endif + %if %{without compat_build} && 0%{?fedora} >= 41 %ifarch %{ix86} %bcond_with mlir @@ -79,6 +94,37 @@ %bcond_with polly %endif +#region pgo +%ifarch %{ix86} +%bcond_with pgo +%else +%if 0%{?fedora} >= 43 || (0%{?rhel} >= 9 && %{maj_ver} >= 21) +%bcond_without pgo +%else +%bcond_with pgo +%endif +%endif + +# We only want to run the performance comparison on snapshot builds. +# centos-streams/RHEL do not have all the requirements. We tried to use pip, +# but we've seen issues on some architectures. We're now restricting this +# to Fedora. +%if %{with pgo} && %{with snapshot_build} && %{defined fedora} +%global run_pgo_perf_comparison 1 +%else +%global run_pgo_perf_comparison %{nil} +%endif + +# Sanity checks for PGO and bootstrapping +#---------------------------------------- +%if %{with pgo} +%ifarch %{ix86} +%{error:Your architecture is not allowed for PGO because it is in this list: %{ix86}} +%endif +%endif +#---------------------------------------- +#endregion pgo + # Disable LTO on x86 and riscv in order to reduce memory consumption. %ifarch %ix86 riscv64 %bcond_with lto_build @@ -86,7 +132,9 @@ %bcond_without lto_build %endif -%if %{without lto_build} +# For PGO Disable LTO for now because of LLVMgold.so not found error +# Use LLVM_ENABLE_LTO:BOOL=ON flags to enable LTO instead +%if 0%{without lto_build} || 0%{with pgo} %global _lto_cflags %nil %endif @@ -112,6 +160,12 @@ %global gts_version 14 %endif +%if %{defined rhel} && 0%{?rhel} <= 8 +%bcond_with libedit +%else +%bcond_without libedit +%endif + # Opt out of https://fedoraproject.org/wiki/Changes/fno-omit-frame-pointer # https://bugzilla.redhat.com/show_bug.cgi?id=2158587 %undefine _include_frame_pointers @@ -123,6 +177,22 @@ %global src_tarball_dir llvm-project-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}.src %endif +%global has_crtobjs 1 +%if %{maj_ver} < 21 +%ifarch s390x +%global has_crtobjs 0 +%endif +%endif + +# LLD uses "fast" as the algortithm for generating build-id +# values while ld.bfd uses "sha1" by default. We need to get lld +# to use the same algorithm or otherwise we end up with errors like thise one: +# +# "build-id found in [...]/usr/lib64/llvm21/bin/llvm-debuginfod-find too small" +# +# NOTE: Originally this is only needed for PGO but it doesn't hurt to have it on all the time. +%global build_ldflags %{?build_ldflags} -Wl,--build-id=sha1 + #region LLVM globals %if %{with compat_build} @@ -140,15 +210,15 @@ %global install_prefix %{_libdir}/llvm%{maj_ver} %global install_bindir %{install_prefix}/bin %global install_includedir %{install_prefix}/include -%global install_libdir %{install_prefix}/lib +%global install_libdir %{install_prefix}/%{_lib} %global install_datadir %{install_prefix}/share %global install_mandir %{install_prefix}/share/man %global install_libexecdir %{install_prefix}/libexec -%global build_libdir llvm/%{_vpath_builddir}/lib -%global unprefixed_libdir lib +%global build_libdir llvm/%{_vpath_builddir}/%{_lib} +%global unprefixed_libdir %{_lib} %if 0%{?rhel} -%global targets_to_build "X86;AMDGPU;PowerPC;NVPTX;SystemZ;AArch64;BPF;WebAssembly" +%global targets_to_build "X86;AMDGPU;PowerPC;NVPTX;SystemZ;AArch64;BPF;WebAssembly;RISCV" %global experimental_targets_to_build "" %else %global targets_to_build "all" @@ -233,6 +303,13 @@ #region polly globals %global pkg_name_polly polly%{pkg_suffix} #endregion polly globals + +#region PGO globals +%if 0%{run_pgo_perf_comparison} +%global llvm_test_suite_dir %{_datadir}/llvm-test-suite +%endif +#endregion PGO globals + #endregion globals #region packages @@ -296,6 +373,7 @@ Source1000: version.spec.inc #region CLANG patches Patch101: 0001-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch Patch102: 0003-PATCH-clang-Don-t-install-static-libraries.patch +Patch2002: 20-131099.patch # Workaround a bug in ORC on ppc64le. # More info is available here: https://reviews.llvm.org/D159115#4641826 @@ -329,10 +407,6 @@ Patch501: 0001-Fix-page-size-constant-on-aarch64-and-ppc64le.patch # https://github.com/llvm/llvm-project/issues/124001 Patch1901: 0001-SystemZ-Fix-ICE-with-i128-i64-uaddo-carry-chain.patch -# Backport fix for https://bugzilla.redhat.com/show_bug.cgi?id=2352554. -# https://github.com/llvm/llvm-project/pull/131801 -Patch2004: 131801.patch - %if 0%{?rhel} == 8 %global python3_pkgversion 3.12 %global __python3 /usr/bin/python3.12 @@ -357,6 +431,28 @@ BuildRequires: zlib-devel BuildRequires: libzstd-devel BuildRequires: libffi-devel BuildRequires: ncurses-devel + +%if %{with pgo} +BuildRequires: lld +BuildRequires: compiler-rt +BuildRequires: llvm + +%if 0%{run_pgo_perf_comparison} +BuildRequires: llvm-test-suite +BuildRequires: tcl-devel +BuildRequires: which +# pandas and scipy are needed for running llvm-test-suite/utils/compare.py +# For RHEL we have to install it from pip and for fedora we take the RPM package. +%if 0%{?rhel} +BuildRequires: python3-pip +%else +BuildRequires: python3-pandas +BuildRequires: python3-scipy +%endif +%endif + +%endif + # This intentionally does not use python3_pkgversion. RHEL 8 does not have # python3.12-sphinx, and we are only using it as a binary anyway. BuildRequires: python3-sphinx @@ -381,8 +477,10 @@ BuildRequires: binutils-gold # Enable extra functionality when run the LLVM JIT under valgrind. BuildRequires: valgrind-devel %endif +%if %{with libedit} # LLVM's LineEditor library will use libedit if it is available. BuildRequires: libedit-devel +%endif # We need python3-devel for %%py3_shebang_fix BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools @@ -463,7 +561,6 @@ tools as well as libraries with equivalent functionality. Summary: LLVM lit test runner for Python 3 BuildArch: noarch -Requires: python%{python3_pkgversion}-setuptools %if 0%{?rhel} == 8 # Became python3.12-clang in LLVM 19 Obsoletes: python3-lit < 18.9 @@ -494,7 +591,9 @@ Requires: %{pkg_name_llvm}-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 %{with libedit} Requires: libedit-devel +%endif Requires: libzstd-devel # The installed cmake files reference binaries from llvm-test, llvm-static, and # llvm-gtest. We tried in the past to split the cmake exports for these binaries @@ -1117,7 +1216,7 @@ sed -i 's/LLDB_ENABLE_PYTHON/TRUE/' lldb/docs/CMakeLists.txt %endif %global projects clang;clang-tools-extra;lld -%global runtimes compiler-rt;openmp;offload +%global runtimes compiler-rt;openmp %if %{with lldb} %global projects %{projects};lldb @@ -1139,6 +1238,10 @@ sed -i 's/LLDB_ENABLE_PYTHON/TRUE/' lldb/docs/CMakeLists.txt %global runtimes %{runtimes};libcxx;libcxxabi;libunwind %endif +%if %{with offload} +%global runtimes %{runtimes};offload +%endif + %global cfg_file_content --gcc-triple=%{_target_cpu}-redhat-linux # We want to use DWARF-5 on all snapshot builds. @@ -1173,6 +1276,17 @@ export ASMFLAGS="%{build_cflags}" cd llvm +# Remember old values to reset to +OLD_PATH="$PATH" +OLD_LD_LIBRARY_PATH="$LD_LIBRARY_PATH" +OLD_CWD="$PWD" + +%global builddir_instrumented $RPM_BUILD_DIR/instrumented-llvm +%if 0%{run_pgo_perf_comparison} +%global builddir_perf_pgo $RPM_BUILD_DIR/performance-of-pgoed-clang +%global builddir_perf_system $RPM_BUILD_DIR/performance-of-system-clang +%endif + #region LLVM lit %if %{with python_lit} pushd utils/lit @@ -1198,7 +1312,8 @@ popd -DBUILD_SHARED_LIBS=OFF \\\ -DLLVM_BUILD_LLVM_DYLIB=ON \\\ -DLLVM_LINK_LLVM_DYLIB=ON \\\ - -DCLANG_LINK_CLANG_DYLIB=ON + -DCLANG_LINK_CLANG_DYLIB=ON \\\ + -DLLVM_ENABLE_FFI:BOOL=ON %global cmake_config_args %{cmake_common_args} @@ -1214,8 +1329,15 @@ popd -DCLANG_INCLUDE_TESTS:BOOL=ON \\\ -DCLANG_PLUGIN_SUPPORT:BOOL=ON \\\ -DCLANG_REPOSITORY_STRING="%{?dist_vendor} %{version}-%{release}" \\\ - -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=../clang-tools-extra \\\ + -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=../clang-tools-extra + +%if %{with compat_build} +%global cmake_config_args %{cmake_config_args} \\\ -DCLANG_RESOURCE_DIR=../../../lib/clang/%{maj_ver} +%else +%global cmake_config_args %{cmake_config_args} \\\ + -DCLANG_RESOURCE_DIR=../lib/clang/%{maj_ver} +%endif #endregion clang options #region compiler-rt options @@ -1294,7 +1416,6 @@ popd -DLLVM_BUILD_TOOLS:BOOL=ON \\\ -DLLVM_BUILD_UTILS:BOOL=ON \\\ -DLLVM_DEFAULT_TARGET_TRIPLE=%{llvm_triple} \\\ - -DLLVM_ENABLE_FFI:BOOL=ON \\\ -DLLVM_ENABLE_LIBCXX:BOOL=OFF \\\ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON \\\ -DLLVM_ENABLE_PROJECTS="%{projects}" \\\ @@ -1360,9 +1481,13 @@ popd %global cmake_config_args %{cmake_config_args} \\\ -DCMAKE_INSTALL_PREFIX=%{install_prefix} \\\ -DENABLE_LINKER_BUILD_ID:BOOL=ON \\\ - -DOFFLOAD_INSTALL_LIBDIR=%{unprefixed_libdir} \\\ -DPython3_EXECUTABLE=%{__python3} +%if %{with offload} +%global cmake_config_args %{cmake_config_args} \\\ + -DOFFLOAD_INSTALL_LIBDIR=%{unprefixed_libdir} +%endif + # During the build, we use both the system clang and the just-built clang, and # they need to use the system and just-built shared objects respectively. If # we use LD_LIBRARY_PATH to point to our build directory, the system clang @@ -1381,6 +1506,10 @@ popd %global cmake_config_args %{cmake_config_args} -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" %endif +%if 0%{?__isa_bits} == 64 + %global cmake_config_args %{cmake_config_args} -DLLVM_LIBDIR_SUFFIX=64 +%endif + %if %{with gold} %global cmake_config_args %{cmake_config_args} -DLLVM_BINUTILS_INCDIR=%{_includedir} %endif @@ -1415,7 +1544,126 @@ if grep 'flags.*la57' /proc/cpuinfo; then fi #endregion cmake options -%cmake -G Ninja %cmake_config_args $extra_cmake_args +%if %{with pgo} +#region Instrument LLVM +%global __cmake_builddir %{builddir_instrumented} + +# For -Wno-backend-plugin see https://llvm.org/docs/HowToBuildWithPGO.html +#%%global optflags_for_instrumented %(echo %{optflags} -Wno-backend-plugin) + +%global cmake_config_args_instrumented %{cmake_config_args} \\\ + -DLLVM_ENABLE_PROJECTS:STRING="clang;lld" \\\ + -DLLVM_ENABLE_RUNTIMES="compiler-rt" \\\ + -DLLVM_TARGETS_TO_BUILD=Native \\\ + -DCMAKE_BUILD_TYPE:STRING=Release \\\ + -DCMAKE_INSTALL_PREFIX=%{builddir_instrumented} \\\ + -DCLANG_INCLUDE_DOCS:BOOL=OFF \\\ + -DLLVM_BUILD_DOCS:BOOL=OFF \\\ + -DLLVM_BUILD_UTILS:BOOL=OFF \\\ + -DLLVM_ENABLE_DOXYGEN:BOOL=OFF \\\ + -DLLVM_ENABLE_SPHINX:BOOL=OFF \\\ + -DLLVM_INCLUDE_DOCS:BOOL=OFF \\\ + -DLLVM_INCLUDE_TESTS:BOOL=OFF \\\ + -DLLVM_INSTALL_UTILS:BOOL=OFF \\\ + -DCLANG_BUILD_EXAMPLES:BOOL=OFF \\\ + \\\ + -DLLVM_BUILD_INSTRUMENTED=IR \\\ + -DLLVM_BUILD_RUNTIME=No \\\ + -DLLVM_ENABLE_LTO:BOOL=Thin \\\ + -DLLVM_USE_LINKER=lld + +# CLANG_INCLUDE_TESTS=ON is needed to make the target "generate-profdata" available +%global cmake_config_args_instrumented %{cmake_config_args_instrumented} \\\ + -DCLANG_INCLUDE_TESTS:BOOL=ON + +# LLVM_INCLUDE_UTILS=ON is needed because the tests enabled by CLANG_INCLUDE_TESTS=ON +# require "FileCheck", "not", "count", etc. +%global cmake_config_args_instrumented %{cmake_config_args_instrumented} \\\ + -DLLVM_INCLUDE_UTILS:BOOL=ON + +# LLVM Profile Warning: Unable to track new values: Running out of static counters. +# Consider using option -mllvm -vp-counters-per-site= to allocate more value profile +# counters at compile time. +%global cmake_config_args_instrumented %{cmake_config_args_instrumented} \\\ + -DLLVM_VP_COUNTERS_PER_SITE=8 + +# TODO(kkleine): Should we see warnings like: +# "function control flow change detected (hash mismatch)" +# then read https://issues.chromium.org/issues/40633598 again. +%cmake -G Ninja %{cmake_config_args_instrumented} $extra_cmake_args + +# Build all the tools we need in order to build generate-profdata and llvm-profdata +%cmake_build --target libclang-cpp.so +%cmake_build --target clang +%cmake_build --target lld +%cmake_build --target llvm-profdata +%cmake_build --target llvm-ar +%cmake_build --target llvm-ranlib +%cmake_build --target llvm-cxxfilt +#endregion Instrument LLVM + +#region Perf training +# Without these exports the function count is ~160 and with them it is ~200,000. +export LD_LIBRARY_PATH="%{builddir_instrumented}/%{_lib}:%{builddir_instrumented}/lib:$OLD_LD_LIBRARY_PATH" +export PATH="%{builddir_instrumented}/bin:$OLD_PATH" + +%cmake_build --target generate-profdata + +# Use the newly compiled llvm-profdata to avoid profile version mismatches like: +# "raw profile version mismatch: Profile uses raw profile format version = 10; expected version = 9" +%global llvm_profdata_bin %{builddir_instrumented}/bin/llvm-profdata +%global llvm_cxxfilt_bin %{builddir_instrumented}/bin/llvm-cxxfilt + +# Show top 10 functions in the profile +%llvm_profdata_bin show --topn=10 %{builddir_instrumented}/tools/clang/utils/perf-training/clang.profdata | %llvm_cxxfilt_bin + +cp %{builddir_instrumented}/tools/clang/utils/perf-training/clang.profdata $RPM_BUILD_DIR/result.profdata + +#endregion Perf training +%endif + +#region Final stage + +#region reset paths and globals +function reset_paths { + export PATH="$OLD_PATH" + export LD_LIBRARY_PATH="$OLD_LD_LIBRARY_PATH" +} +reset_paths + +cd $OLD_CWD +%global _vpath_srcdir . +%global __cmake_builddir %{_vpath_builddir} +#endregion reset paths and globals + +%global extra_cmake_opts %{nil} + +%if %{with pgo} + %global extra_cmake_opts %{extra_cmake_opts} -DLLVM_PROFDATA_FILE=$RPM_BUILD_DIR/result.profdata + # There were a couple of errors that I ran into. One basically said: + # + # Error: LLVM Profile Warning: Unable to track new values: Running out of + # static counters. Consider using option -mllvm -vp-counters-per-site= to + # allocate more value profile counters at compile time. + # + # As a solution I’ve added the --vp-counters-per-site option but this resulted + # in a follow-up error: + # + # Error: clang (LLVM option parsing): for the --vp-counters-per-site option: + # may only occur zero or one times! + # + # The solution was to modify vp-counters-per-site option through + # LLVM_VP_COUNTERS_PER_SITE instead of adding it, hence the + # -DLLVM_VP_COUNTERS_PER_SITE=8. + %global extra_cmake_opts %{extra_cmake_opts} -DLLVM_VP_COUNTERS_PER_SITE=8 +%if 0%{with lto_build} + %global extra_cmake_opts %{extra_cmake_opts} -DLLVM_ENABLE_LTO:BOOL=Thin + %global extra_cmake_opts %{extra_cmake_opts} -DLLVM_ENABLE_FATLTO=ON +%endif + %global extra_cmake_opts %{extra_cmake_opts} -DLLVM_USE_LINKER=lld +%endif + +%cmake -G Ninja %{cmake_config_args} %{extra_cmake_opts} $extra_cmake_args # 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 @@ -1441,8 +1689,74 @@ fi # /usr/lib64/libomptarget.devicertl.a # /usr/lib64/libomptarget-amdgpu-*.bc # /usr/lib64/libomptarget-nvptx-*.bc - %cmake_build --target runtimes +#endregion Final stage + +#region Performance comparison +%if 0%{run_pgo_perf_comparison} + +function run_perf_test { + local build_dir=$1 + + cd %{llvm_test_suite_dir} + %__cmake -G Ninja \ + -S "%{llvm_test_suite_dir}" \ + -B "${build_dir}" \ + -DCMAKE_GENERATOR=Ninja \ + -DCMAKE_C_COMPILER=clang \ + -DCMAKE_CXX_COMPILER=clang++ \ + -DTEST_SUITE_BENCHMARKING_ONLY=ON \ + -DTEST_SUITE_COLLECT_STATS=ON \ + -DTEST_SUITE_USE_PERF=OFF \ + -DTEST_SUITE_SUBDIRS=CTMark \ + -DTEST_SUITE_RUN_BENCHMARKS=OFF \ + -DTEST_SUITE_COLLECT_CODE_SIZE=OFF \ + -C%{llvm_test_suite_dir}/cmake/caches/O3.cmake + + # Build the test-suite + %__cmake --build "${build_dir}" -j1 --verbose + + # Run the tests with lit: + %{builddir_instrumented}/bin/llvm-lit -v -o ${build_dir}/results.json ${build_dir} || true + cd $OLD_CWD +} + +# Run performance test for system clang +reset_paths +run_perf_test %{builddir_perf_system} + +# Run performance test for PGOed clang +reset_paths +FINAL_BUILD_DIR=`pwd`/%{_vpath_builddir} +export LD_LIBRARY_PATH="${FINAL_BUILD_DIR}/lib:${FINAL_BUILD_DIR}/lib64:${LD_LIBRARY_PATH}" +export PATH="${FINAL_BUILD_DIR}/bin:${OLD_PATH}" +run_perf_test %{builddir_perf_pgo} + +# Compare the performance of system and PGOed clang +%if 0%{?rhel} +python3 -m venv compare-env +source ./compare-env/bin/activate +pip install "pandas>=2.2.3" +pip install "scipy>=1.13.1" +MY_PYTHON_BIN=./compare-env/bin/python3 +%endif + +system_llvm_release=$(/usr/bin/clang --version | grep -Po '[0-9]+\.[0-9]+\.[0-9]' | head -n1) +${MY_PYTHON_BIN} %{llvm_test_suite_dir}/utils/compare.py \ + --metric compile_time \ + --lhs-name ${system_llvm_release} \ + --rhs-name pgo-%{version} \ + %{builddir_perf_system}/results.json vs %{builddir_perf_pgo}/results.json > %{builddir_perf_pgo}/results-system-vs-pgo.txt || true + +echo "Result of Performance comparison between system and PGOed clang" +cat %{builddir_perf_pgo}/results-system-vs-pgo.txt + +%if 0%{?rhel} +# Deactivate virtual python environment created ealier +deactivate +%endif +%endif +#endregion Performance comparison #region compat lib cd .. @@ -1457,7 +1771,7 @@ cd .. -DLLVM_INCLUDE_BENCHMARKS=OFF \ -DLLVM_INCLUDE_TESTS=OFF \ %{cmake_common_args} \ -%if %{maj_ver} <= 20 +%if %{compat_maj_ver} <= 19 -DLLVM_TARGETS_TO_BUILD="$(echo %{targets_to_build});Mips;ARM" \ %endif %{nil} @@ -1565,6 +1879,14 @@ EOF # Add a symlink in bindir to clang-format-diff ln -s ../share/clang/clang-format-diff.py %{buildroot}%{install_bindir}/clang-format-diff +# Install the PGO profile that was used to build this LLVM into the clang package +%if 0%{with pgo} +cp -v $RPM_BUILD_DIR/result.profdata %{buildroot}%{install_datadir}/llvm-pgo.profdata +%if 0%{run_pgo_perf_comparison} +cp -v %{builddir_perf_pgo}/results-system-vs-pgo.txt %{buildroot}%{install_datadir}/results-system-vs-pgo.txt +%endif +%endif + # File in the macros file for other packages to use. We are not doing this # in the compat package, because the version macros would # conflict with # eachother if both clang and the clang compat package were installed together. @@ -1585,7 +1907,7 @@ install -p -m644 clang/bindings/python/clang/* %{buildroot}%{python3_sitelib}/cl %py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/clang # install scanbuild-py to python sitelib. -mv %{buildroot}%{install_libdir}/{libear,libscanbuild} %{buildroot}%{python3_sitelib} +mv %{buildroot}%{install_prefix}/lib/{libear,libscanbuild} %{buildroot}%{python3_sitelib} # Cannot use {libear,libscanbuild} style expansion in py_byte_compile. %py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/libear %py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/libscanbuild @@ -1599,7 +1921,7 @@ done %else # Not sure where to put these python modules for the compat build. -rm -Rf %{buildroot}%{install_libdir}/{libear,libscanbuild} +rm -Rf %{buildroot}%{install_prefix}/lib/{libear,libscanbuild} rm %{buildroot}%{install_bindir}/scan-build-py # Not sure where to put the emacs integration files for the compat build. @@ -1626,8 +1948,12 @@ rm -Rvf %{buildroot}%{install_datadir}/clang-doc # TODO: What are the Fedora guidelines for packaging bash autocomplete files? rm -vf %{buildroot}%{install_datadir}/clang/bash-autocomplete.sh -# Create sub-directories in the clang resource directory that will be -# populated by other packages +%if %{without compat_build} +# Move clang resource directory to default prefix. +mkdir -p %{buildroot}%{_prefix}/lib/clang +mv %{buildroot}%{install_prefix}/lib/clang/%{maj_ver} %{buildroot}%{_prefix}/lib/clang/%{maj_ver} +%endif +# Create any missing sub-directories in the clang resource directory. mkdir -p %{buildroot}%{_prefix}/lib/clang/%{maj_ver}/{bin,include,lib,share}/ # Add versioned resource directory macro @@ -1680,7 +2006,7 @@ rm -rf %{buildroot}/%{install_datadir}/gdb # chmod go+w %{buildroot}/%{_datarootdir}/gdb/python/ompd/ompdModule.so # chmod +w %{buildroot}/%{_datarootdir}/gdb/python/ompd/ompdModule.so -%ifnarch %{ix86} +%if %{with offload} # Remove files that we don't package, yet. rm %{buildroot}%{install_bindir}/llvm-offload-device-info rm %{buildroot}%{install_bindir}/llvm-omp-kernel-replay @@ -1713,7 +2039,7 @@ rmdir %{buildroot}%{install_prefix}/%{_lib}/python%{python3_version} # python: fix binary libraries location liblldb=$(basename $(readlink -e %{buildroot}%{install_libdir}/liblldb.so)) -ln -vsf "../../../llvm%{maj_ver}/lib/${liblldb}" %{buildroot}%{python3_sitearch}/lldb/_lldb.so +ln -vsf "../../../${liblldb}" %{buildroot}%{python3_sitearch}/lldb/_lldb.so %py_byte_compile %{__python3} %{buildroot}%{python3_sitearch}/lldb %endif %endif @@ -1754,40 +2080,9 @@ popd rm -f %{buildroot}%{install_libdir}/libLLVMBOLT*.a #endregion BOLT installation -# Create symlinks from the system install prefix to the llvm install prefix. -# Do this at the end so it includes any files added by preceding steps. -mkdir -p %{buildroot}%{_bindir} -for f in %{buildroot}%{install_bindir}/*; do - filename=`basename $f` - if [[ "$filename" == "clang-%{maj_ver}" ]]; then - continue - fi - # Add symlink for binaries with version suffix. - ln -s ../../%{install_bindir}/$filename %{buildroot}/%{_bindir}/$filename-%{maj_ver} - # For non-compat builds, also add a symlink without version suffix. - %if %{without compat_build} - ln -s ../../%{install_bindir}/$filename %{buildroot}/%{_bindir}/$filename - %endif -done - -# Move man pages to system install prefix. -mkdir -p %{buildroot}%{_mandir}/man1 -for f in %{buildroot}%{install_mandir}/man1/*; do - filename=`basename $f` - filename=${filename%.1} - mv $f %{buildroot}%{_mandir}/man1/$filename-%{maj_ver}.1 - %if %{without compat_build} - ln -s $filename-%{maj_ver}.1 %{buildroot}%{_mandir}/man1/$filename.1 - %endif -done -rmdir %{buildroot}%{install_mandir}/man1 -rmdir %{buildroot}%{install_mandir} - -%if %{without compat_build} -# We don't create directory symlinks, because RPM does not support -# switching between a directory and a symlink, causing upgrade/downgrade issues. -# Instead, recursively copy the directories while creating symlinks. -copy_with_relative_symlinks() { +# Move files from src to dest and replace the old files in src with relative +# symlinks. +move_and_replace_with_symlinks() { local src="$1" local dest="$2" mkdir -p "$dest" @@ -1795,14 +2090,59 @@ copy_with_relative_symlinks() { # Change to source directory to simplify relative paths (cd "$src" && \ find * -type d -exec mkdir -p "$dest/{}" \; && \ - find * \( -type f -o -type l \) -exec ln -s --relative "$src/{}" "$dest/{}" \;) + find * \( -type f -o -type l \) -exec mv "$src/{}" "$dest/{}" \; \ + -exec ln -s --relative "$dest/{}" "$src/{}" \;) } -# Add symlinks for libraries. -copy_with_relative_symlinks %{buildroot}%{install_libdir} %{buildroot}%{_libdir} -copy_with_relative_symlinks %{buildroot}%{install_libexecdir} %{buildroot}%{_libexecdir} -copy_with_relative_symlinks %{buildroot}%{install_includedir} %{buildroot}%{_includedir} -copy_with_relative_symlinks %{buildroot}%{install_datadir} %{buildroot}%{_datadir} +%if %{without compat_build} +# Move files from the llvm prefix to the system prefix and replace them with +# symlinks. We do it this way around because symlinks between multilib packages +# would conflict otherwise. +move_and_replace_with_symlinks %{buildroot}%{install_bindir} %{buildroot}%{_bindir} +move_and_replace_with_symlinks %{buildroot}%{install_libdir} %{buildroot}%{_libdir} +move_and_replace_with_symlinks %{buildroot}%{install_libexecdir} %{buildroot}%{_libexecdir} +move_and_replace_with_symlinks %{buildroot}%{install_includedir} %{buildroot}%{_includedir} +move_and_replace_with_symlinks %{buildroot}%{install_datadir} %{buildroot}%{_datadir} +%endif + +# Create versioned symlinks for binaries. +# Do this at the end so it includes any files added by preceding steps. +mkdir -p %{buildroot}%{_bindir} +for f in %{buildroot}%{install_bindir}/*; do + filename=`basename $f` + if [[ "$filename" =~ ^(lit|ld|clang-%{maj_ver})$ ]]; then + continue + fi + %if %{with compat_build} + ln -s ../../%{install_bindir}/$filename %{buildroot}/%{_bindir}/$filename-%{maj_ver} + %else + # clang-NN is already created by the build system. + if [[ "$filename" == "clang" ]]; then + continue + fi + ln -s $filename %{buildroot}/%{_bindir}/$filename-%{maj_ver} + %endif +done + +mkdir -p %{buildroot}%{_mandir}/man1 +for f in %{buildroot}%{install_mandir}/man1/*; do + filename=`basename $f` + filename=${filename%.1} + %if %{with compat_build} + # Move man pages to system install prefix. + mv $f %{buildroot}%{_mandir}/man1/$filename-%{maj_ver}.1 + %else + # Create suffixed symlink. + ln -s $filename.1 %{buildroot}%{_mandir}/man1/$filename-%{maj_ver}.1 + %endif +done +rm -rf %{buildroot}%{install_mandir} + +# As an exception, always keep llvm-config in the versioned prefix. +# The llvm-config in the default prefix will be managed by alternatives. +%if %{without compat_build} +rm %{buildroot}%{install_bindir}/llvm-config +mv %{buildroot}%{_bindir}/llvm-config %{buildroot}%{install_bindir}/llvm-config %endif # ghost presence for llvm-config, managed by alternatives. @@ -1973,13 +2313,14 @@ export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_curr_parallel_handle.c" export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_display_control_vars.c" export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_thread_handle.c" +%if %{with pgo} +# TODO(kkleine): I unset LIT_XFAIL here because the tests above unexpectedly passed since Aug 16th on fedora-40-x86_64 +unset LIT_XFAIL +%endif + # The following test is flaky and we'll filter it out -test_list_filter_out+=("libomp :: ompt/teams/distribute_dispatch.c") test_list_filter_out+=("libomp :: affinity/kmp-abs-hw-subset.c") -test_list_filter_out+=("libomp :: parallel/bug63197.c") -test_list_filter_out+=("libomp :: tasking/issue-69733.c") -test_list_filter_out+=("libarcher :: races/task-taskgroup-unrelated.c") -test_list_filter_out+=("libarcher :: races/task-taskwait-nested.c") +test_list_filter_out+=("libomp :: ompt/teams/distribute_dispatch.c") # These tests fail more often than not, but not always. test_list_filter_out+=("libomp :: worksharing/for/omp_collapse_many_GELTGT_int.c") @@ -1987,22 +2328,31 @@ test_list_filter_out+=("libomp :: worksharing/for/omp_collapse_many_GTGEGT_int.c test_list_filter_out+=("libomp :: worksharing/for/omp_collapse_many_LTLEGE_int.c") test_list_filter_out+=("libomp :: worksharing/for/omp_collapse_one_int.c") +%if %{maj_ver} < 21 +# The following test is flaky and we'll filter it out +test_list_filter_out+=("libomp :: parallel/bug63197.c") +test_list_filter_out+=("libomp :: tasking/issue-69733.c") +test_list_filter_out+=("libarcher :: races/task-taskgroup-unrelated.c") + # The following tests have been failing intermittently. # Issue upstream: https://github.com/llvm/llvm-project/issues/127796 test_list_filter_out+=("libarcher :: races/task-two.c") test_list_filter_out+=("libarcher :: races/lock-nested-unrelated.c") +%endif %ifarch s390x test_list_filter_out+=("libomp :: flush/omp_flush.c") test_list_filter_out+=("libomp :: worksharing/for/omp_for_schedule_guided.c") %endif +%if %{maj_ver} < 21 %ifarch aarch64 s390x # The following test has been failing intermittently on aarch64 and s390x. # Re-enable it after https://github.com/llvm/llvm-project/issues/117773 # gets fixed. test_list_filter_out+=("libarcher :: races/taskwait-depend.c") %endif +%endif # The following tests seem pass on ppc64le and x86_64 and aarch64 only: %ifnarch ppc64le x86_64 s390x aarch64 @@ -2046,6 +2396,7 @@ export LIT_XFAIL="$LIT_XFAIL;races/task-dependency.c" export LIT_XFAIL="$LIT_XFAIL;races/task-taskgroup-unrelated.c" export LIT_XFAIL="$LIT_XFAIL;races/task-two.c" export LIT_XFAIL="$LIT_XFAIL;races/taskwait-depend.c" +export LIT_XFAIL="$LIT_XFAIL;races/task-taskwait-nested.c" export LIT_XFAIL="$LIT_XFAIL;reduction/parallel-reduction-nowait.c" export LIT_XFAIL="$LIT_XFAIL;reduction/parallel-reduction.c" export LIT_XFAIL="$LIT_XFAIL;task/omp_task_depend_all.c" @@ -2104,9 +2455,22 @@ export LIT_XFAIL="$LIT_XFAIL;offloading/thread_state_2.c" adjust_lit_filter_out test_list_filter_out +%if %{maj_ver} >= 21 +# This allows openmp tests to be re-run 4 times. Once they pass +# after being re-run, they are marked as FLAKYPASS. +# See https://github.com/llvm/llvm-project/pull/141851 for the +# --max-retries-per-test option. +# We don't know if 4 is the right number to use here we just +# need to start with some number. +# Once https://github.com/llvm/llvm-project/pull/142413 landed +# we can see the exact number of attempts the tests needed +# to pass. And then we can adapt this number. +export LIT_OPTS="$LIT_OPTS --max-retries-per-test=4" +%endif + %if 0%{?rhel} # libomp tests are often very slow on s390x brew builders -%ifnarch s390x +%ifnarch s390x riscv64 %cmake_build --target check-openmp %endif %else @@ -2234,7 +2598,13 @@ cp %{_vpath_builddir}/.ninja_log %{buildroot}%{_datadir} %post -n %{pkg_name_llvm}-devel update-alternatives --install %{_bindir}/llvm-config-%{maj_ver} llvm-config-%{maj_ver} %{install_bindir}/llvm-config %{__isa_bits} %if %{without compat_build} -update-alternatives --install %{_bindir}/llvm-config llvm-config %{install_bindir}/llvm-config %{__isa_bits} +# Prioritize newer LLVM versions over older and 64-bit over 32-bit. +update-alternatives --install %{_bindir}/llvm-config llvm-config %{install_bindir}/llvm-config $((%{maj_ver}*100+%{__isa_bits})) + +# Remove old llvm-config-%{__isa_bits} alternative. This will only do something during the +# first upgrade from a version that used it. In all other cases it will error, so suppress the +# expected error message. +update-alternatives --remove llvm-config %{_bindir}/llvm-config-%{__isa_bits} 2>/dev/null ||: # During the upgrade from LLVM 16 (F38) to LLVM 17 (F39), we found out the # main llvm-devel package was leaving entries in the alternatives system. @@ -2252,14 +2622,14 @@ if [ $1 -eq 0 ]; then update-alternatives --remove llvm-config%{exec_suffix} %{install_bindir}/llvm-config fi %if %{without compat_build} -# When upgrading between minor versions (i.e. from x.y.1 to x.y.2), we must -# not remove the alternative. -# However, during a major version upgrade (i.e. from 16.x.y to 17.z.w), the -# alternative must be removed in order to give priority to a newly installed -# compat package. -if [[ $1 -eq 0 - || "x$(%{_bindir}/llvm-config%{exec_suffix} --version | awk -F . '{ print $1 }')" != "x%{maj_ver}" ]]; then - update-alternatives --remove llvm-config-%{maj_ver} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} +# There are a number of different cases here: +# Uninstall: Remove alternatives. +# Patch version upgrade: Keep alternatives. +# Major version upgrade with installation of compat package: Keep alternatives for compat package. +# Major version upgrade without installation of compat package: Remove alternatives. However, we +# can't distinguish it from the previous case, so we conservatively leave it behind. +if [ $1 -eq 0 ]; then + update-alternatives --remove llvm-config-%{maj_ver} %{install_bindir}/llvm-config fi %endif @@ -2428,6 +2798,12 @@ fi yaml2obj }} +%if %{maj_ver} >= 21 +%{expand_bins %{expand: + llvm-ml64 +}} +%endif + %{expand_mans %{expand: bugpoint clang-tblgen @@ -2554,6 +2930,14 @@ fi llvm-isel-fuzzer llvm-opt-fuzzer }} +%if %{maj_ver} >= 21 +%{expand_bins %{expand: + llvm-test-mustache-spec +}} +%{expand_mans %{expand: + llvm-test-mustache-spec +}} +%endif %files -n %{pkg_name_llvm}-googletest %license llvm/LICENSE.TXT @@ -2593,6 +2977,14 @@ fi %endif %{expand_mans clang clang++} +%if 0%{with pgo} +%{expand_datas %{expand: llvm-pgo.profdata }} +%if 0%{run_pgo_perf_comparison} +%{expand_datas %{expand: results-system-vs-pgo.txt }} +%endif +%endif + + %files -n %{pkg_name_clang}-libs %license clang/LICENSE.TXT %{_prefix}/lib/clang/%{maj_ver}/include/* @@ -2695,6 +3087,12 @@ fi clang-format-diff run-clang-tidy }} +%if %{maj_ver} >= 21 +%{expand_bins %{expand: + offload-arch +}} +%endif + %if %{without compat_build} %{_emacs_sitestartdir}/clang-format.el %{_emacs_sitestartdir}/clang-include-fixer.el @@ -2742,12 +3140,12 @@ fi # Files that appear on all targets %{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/libclang_rt.* -%ifnarch s390x +%if %{has_crtobjs} %{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/clang_rt.crtbegin.o %{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/clang_rt.crtend.o %endif -%ifnarch %{ix86} s390x +%ifnarch %{ix86} s390x riscv64 %{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/liborc_rt.a %endif @@ -2767,9 +3165,7 @@ fi libompd.so libarcher.so }} -%ifnarch %{ix86} -# libomptarget is not supported on 32-bit systems. -# s390x does not support the offloading plugins. +%if %{with offload} %expand_libs libomptarget.so.%{so_suffix} %expand_libs libLLVMOffload.so.%{so_suffix} %endif @@ -2782,16 +3178,27 @@ fi %{_prefix}/lib/clang/%{maj_ver}/include/ompt.h %{_prefix}/lib/clang/%{maj_ver}/include/ompt-multiplex.h %expand_libs cmake/openmp -%ifnarch %{ix86} -# libomptarget is not supported on 32-bit systems. -# s390x does not support the offloading plugins. +%if %{with offload} +%{expand_libs %{expand: + libomptarget.so + libLLVMOffload.so +}} + +%if %{maj_ver} < 21 %{expand_libs %{expand: libomptarget.devicertl.a libomptarget-amdgpu*.bc libomptarget-nvptx*.bc - libomptarget.so - libLLVMOffload.so }} +%else +%{expand_libs %{expand: + amdgcn-amd-amdhsa/libompdevice.a + amdgcn-amd-amdhsa/libomptarget-amdgpu.bc + nvptx64-nvidia-cuda/libompdevice.a + nvptx64-nvidia-cuda/libomptarget-nvptx.bc +}} +%endif + %expand_includes offload %endif #endregion OPENMP files @@ -3025,7 +3432,63 @@ fi #region changelog %changelog -* Thu May 15 2025 Nikita Popov - 20.1.3-1 +* Wed Jul 09 2025 Nikita Popov - 20.1.8-1 +- Update to LLVM 20.1.8 + +* Fri Jun 20 2025 Kashyap Chamarthy - 20.1.7-2 +- Add riscv64 enablement bits; thanks: Songsong Zhang + (U2FsdGVkX1@gmail.com) and David Abdurachmanov (davidlt@rivosinc.com) + +* Thu Jun 19 2025 Nikita Popov - 20.1.7-1 +- Update to LLVM 20.1.7 + +* Tue Jun 17 2025 Nikita Popov - 20.1.6-10 +- Fix llvm-config alternatives handling (rhbz#2361779) + +* Mon Jun 16 2025 Nikita Popov - 20.1.6-9 +- Use libdir suffix in versioned prefix + +* Tue Jun 10 2025 Nikita Popov - 20.1.6-8 +- Invert symlink direction +- Fix i686 multilib installation (rhbz#2365079) + +* Thu Jun 05 2025 Timm Bäder - 20.1.6-7 +- Backport patch to fix rhbz#2363895 + +* Wed Jun 04 2025 Python Maint - 20.1.6-6 +- Rebuilt for Python 3.14 + +* Wed Jun 04 2025 Python Maint - 20.1.6-5 +- Bootstrap for Python 3.14 + +* Wed Jun 04 2025 Python Maint - 20.1.6-4 +- Rebuilt for Python 3.14 + +* Tue Jun 03 2025 Tulio Magno Quites Machado Filho - 20.1.6-3 +- Remove temporary changes on ppc64le + +* Tue Jun 03 2025 Python Maint - 20.1.6-2 +- Rebuilt for Python 3.14 + +* Fri May 30 2025 Nikita Popov - 20.1.6-1 +- Update to LLVM 20.1.6 + +* Mon May 26 2025 Konrad Kleine - 20.1.5-2 +- Build with PGO + +* Thu May 22 2025 Nikita Popov - 20.1.5-1 +- Update to LLVM 20.1.5 + +* Tue May 06 2025 Tom Stellard - 20.1.4-6 +- Fix build on ppc64le with glibc >= 2.42 + +* Tue May 06 2025 Nikita Popov - 20.1.4-5 +- Update to LLVM 20.1.4 + +* Sat Apr 26 2025 Tom Stellard - 20.1.3-2 +- Fix build with glibc >= 2.42 + +* Thu Apr 17 2025 Nikita Popov - 20.1.3-1 - Update to LLVM 20.1.3 * Thu May 15 2025 Nikita Popov - 20.1.2-3 diff --git a/rpminspect.yaml b/rpminspect.yaml index 18c241f..3f5febc 100644 --- a/rpminspect.yaml +++ b/rpminspect.yaml @@ -1,4 +1,9 @@ --- +inspections: + # We need to disable abidiff due to abidiff+testing-farm issues. Ref link: + # https://docs.testing-farm.io/Testing%20Farm/0.1/errors.html#TFE-1 + abidiff: off + badfuncs: # For compiler-rt, we allow the following forbidden functions: # - gethostbyname diff --git a/sources b/sources index f7d138f..a33516a 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (llvm-project-19.1.7.src.tar.xz) = c7d63286d662707a9cd54758c9e3aaf52794a91900c484c4a6efa62d90bc719d5e7a345e4192feeb0c9fd11c82570d64677c781e5be1d645556b6aa018e47ec8 SHA512 (llvm-project-19.1.7.src.tar.xz.sig) = 195797b06ac80a742e0ccbc03a50dc06dd2e04377d783d5474e3e72c5a75203b60292b047929312a411d22b137a239943fba414a4d136a2be14cbff978eb6bda -SHA512 (llvm-project-20.1.3.src.tar.xz) = 79d6cfd10075ec9d05b9a359c09579e07a2caff9167518519457daee3e37a818100da6712804916880797ecb0b4891b18dc52a03b534e1b9d1d4bb5ba8d5ad1e -SHA512 (llvm-project-20.1.3.src.tar.xz.sig) = 4fd3815cd94113234e66083f955993a95c888cbb89d5baf611b76765511e102af9f1e880cbacc709f0be8785abd5abbfb0ce391793308dfec3c248a9b348e492 +SHA512 (llvm-project-20.1.8.src.tar.xz) = f330e72e6a1da468569049437cc0ba7a41abb816ccece7367189344f7ebfef730f4788ac7af2bef0aa8a49341c15ab1d31e941ffa782f264d11fe0dc05470773 +SHA512 (llvm-project-20.1.8.src.tar.xz.sig) = d74369bdb4d1b82775161ea53c9c5f3a23ce810f4df5ff617123023f9d8ce720e7d6ecc9e17f8ebd39fd9e7a9de79560abdf2ffe73bcb907a43148d43665d619