Update to LLVM 17.0.2

Resolves: RHEL-9028
This commit is contained in:
Nikita Popov 2023-10-04 14:30:52 +02:00
parent 5b187b6a89
commit f5e95901ab
6 changed files with 54 additions and 127 deletions

4
.gitignore vendored
View File

@ -1,7 +1,5 @@
SOURCES/openmp-15.0.7.src.tar.xz
SOURCES/release-keys.asc
/openmp-15.0.7.src.tar.xz
/release-keys.asc
/openmp-16.0.0.src.tar.xz
/openmp-16.0.0.src.tar.xz.sig
/cmake-16.0.0.src.tar.xz
@ -10,3 +8,5 @@ SOURCES/release-keys.asc
/openmp-16.0.6.src.tar.xz.sig
/cmake-16.0.6.src.tar.xz
/cmake-16.0.6.src.tar.xz.sig
/openmp-17.0.2.src.tar.xz
/openmp-17.0.2.src.tar.xz.sig

View File

@ -1,27 +0,0 @@
From f2c9c1c9cda831a4305e2dc8899d630ed727353a Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Tue, 16 May 2017 11:52:19 -0400
Subject: [PATCH] [PATCH][openmp] CMake: Make LIBOMP_HEADERS_INSTALL_PATH a
cache variable when bulding standalone
This way it can be overriden on the command line.
---
openmp/runtime/src/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
index 822f9ca..583a3c3 100644
--- a/openmp/runtime/src/CMakeLists.txt
+++ b/openmp/runtime/src/CMakeLists.txt
@@ -346,7 +346,7 @@ add_dependencies(libomp-micro-tests libomp-test-deps)
# We want to install libomp in DESTDIR/CMAKE_INSTALL_PREFIX/lib
# We want to install headers in DESTDIR/CMAKE_INSTALL_PREFIX/include
if(${OPENMP_STANDALONE_BUILD})
- set(LIBOMP_HEADERS_INSTALL_PATH "${CMAKE_INSTALL_INCLUDEDIR}")
+ set(LIBOMP_HEADERS_INSTALL_PATH include CACHE PATH "Install path for OpenMP headers")
else()
string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION ${PACKAGE_VERSION})
set(LIBOMP_HEADERS_INSTALL_PATH "${OPENMP_INSTALL_LIBDIR}/clang/${CLANG_VERSION}/include")
--
1.8.3.1

View File

@ -1,44 +0,0 @@
diff --git a/openmp/runtime/src/kmp_os.h b/openmp/runtime/src/kmp_os.h
--- a/openmp/runtime/src/kmp_os.h
+++ b/openmp/runtime/src/kmp_os.h
@@ -17,6 +17,7 @@
#include <atomic>
#include <stdarg.h>
#include <stdlib.h>
+#include <string.h>
#define KMP_FTN_PLAIN 1
#define KMP_FTN_APPEND 2
@@ -864,15 +865,25 @@
__sync_lock_test_and_set((volatile kmp_uint64 *)(p), (kmp_uint64)(v))
inline kmp_real32 KMP_XCHG_REAL32(volatile kmp_real32 *p, kmp_real32 v) {
- kmp_int32 tmp =
- __sync_lock_test_and_set((volatile kmp_uint32 *)(p), *(kmp_uint32 *)&v);
- return *(kmp_real32 *)&tmp;
+ volatile kmp_uint32 *up;
+ kmp_uint32 uv;
+ memcpy(&up, &p, sizeof(up));
+ memcpy(&uv, &v, sizeof(uv));
+ kmp_int32 tmp = __sync_lock_test_and_set(up, uv);
+ kmp_real32 ftmp;
+ memcpy(&ftmp, &tmp, sizeof(tmp));
+ return ftmp;
}
inline kmp_real64 KMP_XCHG_REAL64(volatile kmp_real64 *p, kmp_real64 v) {
- kmp_int64 tmp =
- __sync_lock_test_and_set((volatile kmp_uint64 *)(p), *(kmp_uint64 *)&v);
- return *(kmp_real64 *)&tmp;
+ volatile kmp_uint64 *up;
+ kmp_uint64 uv;
+ memcpy(&up, &p, sizeof(up));
+ memcpy(&uv, &v, sizeof(uv));
+ kmp_int64 tmp = __sync_lock_test_and_set(up, uv);
+ kmp_real64 dtmp;
+ memcpy(&dtmp, &tmp, sizeof(tmp));
+ return dtmp;
}
#else

View File

@ -1,12 +0,0 @@
diff -ruN openmp-14.0.0.src.orig/runtime/src/kmp_lock.cpp openmp-14.0.0.src/runtime/src/kmp_lock.cpp
--- a/openmp-14.0.0.src.orig/runtime/src/kmp_lock.cpp 2022-03-14 10:44:55.000000000 +0100
+++ b/openmp-14.0.0.src/runtime/src/kmp_lock.cpp 2022-04-22 10:58:26.736078432 +0200
@@ -2663,7 +2663,7 @@
}
// Truncated binary exponential backoff function
-void __kmp_spin_backoff(kmp_backoff_t *boff) {
+void __attribute__((optimize("O1"))) __kmp_spin_backoff(kmp_backoff_t *boff) {
// We could flatten this loop, but making it a nested loop gives better result
kmp_uint32 i;
for (i = boff->step; i > 0; i--) {

View File

@ -1,9 +1,26 @@
%global maj_ver 16
%global libomp_version %{maj_ver}.0.6
%bcond_with snapshot_build
%if %{with snapshot_build}
# Unlock LLVM Snapshot LUA functions
%{llvm_sb}
%endif
%global maj_ver 17
%global libomp_version %{maj_ver}.0.2
#global rc_ver 4
%global libomp_srcdir openmp-%{libomp_version}%{?rc_ver:rc%{rc_ver}}.src
%global cmake_srcdir cmake-%{libomp_version}%{?rc_ver:rc%{rc_ver}}.src
%global so_suffix %{maj_ver}
%if %{with snapshot_build}
%undefine rc_ver
%global maj_ver %{llvm_snapshot_version_major}
%global libomp_version %{llvm_snapshot_version}
%global so_suffix %{maj_ver}%{llvm_snapshot_version_suffix}
%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
%ifarch ppc64le
%global libomp_arch ppc64
@ -19,20 +36,23 @@
Name: libomp
Version: %{libomp_version}%{?rc_ver:~rc%{rc_ver}}
Release: 3%{?dist}
Release: 1%{?dist}
Summary: OpenMP runtime for clang
License: NCSA
URL: http://openmp.llvm.org
%if %{with snapshot_build}
Source0: %{llvm_snapshot_source_prefix}openmp-%{llvm_snapshot_yyyymmdd}.src.tar.xz
%{llvm_snapshot_extra_source_tags}
%else
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libomp_version}%{?rc_ver:-rc%{rc_ver}}/%{libomp_srcdir}.tar.xz
Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libomp_version}%{?rc_ver:-rc%{rc_ver}}/%{libomp_srcdir}.tar.xz.sig
Source2: release-keys.asc
%endif
Source3: run-lit-tests
Source4: lit.fedora.cfg.py
Source5: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libomp_version}%{?rc_ver:-rc%{rc_ver}}/%{cmake_srcdir}.tar.xz
Source6: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libomp_version}%{?rc_ver:-rc%{rc_ver}}/%{cmake_srcdir}.tar.xz.sig
BuildRequires: clang
BuildRequires: clang >= %{maj_ver}
# For clang-offload-packager
BuildRequires: clang-tools-extra
BuildRequires: cmake
@ -48,9 +68,9 @@ BuildRequires: ncurses-devel
# For gpg source verification
BuildRequires: gnupg2
# libomptarget needs the llvm cmake files
BuildRequires: llvm-devel
BuildRequires: llvm-cmake-utils
Requires: elfutils-libelf%{?isa}
@ -86,32 +106,30 @@ OpenMP regression tests
%endif
%prep
%if %{without snapshot_build}
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE6}' --data='%{SOURCE5}'
%setup -T -q -b 5 -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
%endif
%autosetup -n %{libomp_srcdir} -p2
%build
%undefine __cmake_in_source_build
# LTO causes build failures in this package. Disable LTO for now
# https://bugzilla.redhat.com/show_bug.cgi?id=1988155
%define _lto_cflags %{nil}
mkdir -p %{_vpath_builddir}
cd %{_vpath_builddir}
%cmake .. -GNinja \
%cmake -GNinja \
-DLIBOMP_INSTALL_ALIASES=OFF \
-DCMAKE_MODULE_PATH=%{_libdir}/cmake/llvm \
-DCMAKE_MODULE_PATH=%{_datadir}/llvm/cmake/Modules \
-DLLVM_DIR=%{_libdir}/cmake/llvm \
-DCMAKE_INSTALL_INCLUDEDIR=%{_libdir}/clang/%{maj_ver}/include \
-DCMAKE_INSTALL_INCLUDEDIR=%{_prefix}/lib/clang/%{maj_ver}/include \
%if 0%{?__isa_bits} == 64
-DOPENMP_LIBDIR_SUFFIX=64 \
%else
-DOPENMP_LIBDIR_SUFFIX= \
%endif
%if %{with snapshot_build}
-DLLVM_VERSION_SUFFIX="%{llvm_snapshot_version_suffix}" \
%endif
-DCMAKE_SKIP_RPATH:BOOL=ON
@ -119,7 +137,6 @@ cd %{_vpath_builddir}
%install
cd %{_vpath_builddir}
%cmake_install
%if %{with testpkg}
@ -135,7 +152,6 @@ install -d %{buildroot}%{libomp_srcdir}/runtime
cp -R runtime/test %{buildroot}%{libomp_srcdir}/runtime
cp -R runtime/src %{buildroot}%{libomp_srcdir}/runtime
cd %{_vpath_builddir}
# Generate lit config files. Strip off the last line that initiates the
# test run, so we can customize the configuration.
head -n -1 runtime/test/lit.site.cfg >> %{buildroot}%{lit_cfg}
@ -157,7 +173,6 @@ install -m 0755 %{SOURCE3} %{buildroot}%{_libexecdir}/tests/libomp
rm -rf %{buildroot}%{_libdir}/libarcher_static.a
%check
cd %{_vpath_builddir}
%cmake_build --target check-openmp || true
%files
@ -169,31 +184,25 @@ cd %{_vpath_builddir}
%endif
%ifnarch %{ix86} %{arm}
# libomptarget is not supported on 32-bit systems.
%{_libdir}/libomptarget.rtl.amdgpu.so.%{maj_ver}
%{_libdir}/libomptarget.rtl.amdgpu.nextgen.so.%{maj_ver}
%{_libdir}/libomptarget.rtl.cuda.so.%{maj_ver}
%{_libdir}/libomptarget.rtl.cuda.nextgen.so.%{maj_ver}
%{_libdir}/libomptarget.rtl.%{libomp_arch}.so.%{maj_ver}
%{_libdir}/libomptarget.rtl.%{libomp_arch}.nextgen.so.%{maj_ver}
%{_libdir}/libomptarget.so.%{maj_ver}
%{_libdir}/libomptarget.rtl.amdgpu.so.%{so_suffix}
%{_libdir}/libomptarget.rtl.cuda.so.%{so_suffix}
%{_libdir}/libomptarget.rtl.%{libomp_arch}.so.%{so_suffix}
%{_libdir}/libomptarget.so.%{so_suffix}
%endif
%files devel
%{_libdir}/clang/%{maj_ver}/include/omp.h
%{_libdir}/cmake/openmp/FindOpenMPTarget.cmake
%{_prefix}/lib/clang/%{maj_ver}/include/omp.h
%ifnarch %{arm}
%{_libdir}/clang/%{maj_ver}/include/omp-tools.h
%{_libdir}/clang/%{maj_ver}/include/ompt.h
%{_libdir}/clang/%{maj_ver}/include/ompt-multiplex.h
%{_prefix}/lib/clang/%{maj_ver}/include/omp-tools.h
%{_prefix}/lib/clang/%{maj_ver}/include/ompt.h
%{_prefix}/lib/clang/%{maj_ver}/include/ompt-multiplex.h
%endif
%{_libdir}/cmake/openmp/FindOpenMPTarget.cmake
%ifnarch %{ix86} %{arm}
# libomptarget is not supported on 32-bit systems.
%{_libdir}/libomptarget.rtl.amdgpu.so
%{_libdir}/libomptarget.rtl.amdgpu.nextgen.so
%{_libdir}/libomptarget.rtl.cuda.so
%{_libdir}/libomptarget.rtl.cuda.nextgen.so
%{_libdir}/libomptarget.rtl.%{libomp_arch}.so
%{_libdir}/libomptarget.rtl.%{libomp_arch}.nextgen.so
%{_libdir}/libomptarget.devicertl.a
%{_libdir}/libomptarget-amdgpu-*.bc
%{_libdir}/libomptarget-nvptx-*.bc
@ -207,6 +216,9 @@ cd %{_vpath_builddir}
%endif
%changelog
* Wed Oct 04 2023 Nikita Popov <npopov@redhat.com> - 17.0.2-1
- Update to LLVM 17.0.2
* Sat Jul 15 2023 Tom Stellard <tstellar@redhat.com> - 16.0.6-3
- Remove duplicated installed binaries

View File

@ -1,4 +1,2 @@
SHA512 (openmp-16.0.6.src.tar.xz) = b68b60bd10ae6df3853513c163d6d6dc040cdcd4b48802002cd0da24d3c3bc88002e432012081beff15e887fb12b71ef0932f89f21229a80c61568c1643460fc
SHA512 (openmp-16.0.6.src.tar.xz.sig) = e9e8e4c330d9ee246d0d83fb0d83805368e591d8e9e0ab1d27084655a6b2653e20f8ef5bfa59ae7e373a771df74114e5ee0a216e5f3a07e6b57769501b1900cf
SHA512 (cmake-16.0.6.src.tar.xz) = 52ecd941d2d85a5b668caa5d0d40480cb6a97b3bf1174e634c2a93e9ef6d03670ca7e96abb0a60cb33ba537b93d5788754dab1f2f45c1f623f788162717d088b
SHA512 (cmake-16.0.6.src.tar.xz.sig) = d20c5e51315aa476775e6ce886684b9f882ce283fc40aa6c1b8f03964c77a1e745e2e1fb00b3488dddfe1a04378e2bfd090350de28e58088525a5305ecb1bea6
SHA512 (openmp-17.0.2.src.tar.xz) = 78b5e8b773b8780a1a1db54ab75425dedeef35ac894ae77de39f9035063312f56cb811b2459939c0f1d79a28c6b02a598b1f24bd5367c23f13d579e2f534983a
SHA512 (openmp-17.0.2.src.tar.xz.sig) = 727f6e963d00c3ef1b336a5acc65ceb9c26bce1694349e57af05b6b4ea4ee8be0b083d0f7043f738b2fecb20e9e14a626afc01fa5bdbb1952cafc122ff30f5ef