import libomp-14.0.0-2.module+el8.7.0+15272+f8692459

This commit is contained in:
CentOS Sources 2022-05-19 10:23:40 +00:00 committed by Stepan Oksanichenko
parent 044559726b
commit 8daa9f7950
2 changed files with 51 additions and 1 deletions

View File

@ -0,0 +1,44 @@
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

@ -11,7 +11,7 @@
Name: libomp
Version: %{libomp_version}%{?rc_ver:~rc%{rc_ver}}
Release: 1%{?dist}
Release: 2%{?dist}
Summary: OpenMP runtime for clang
License: NCSA
@ -27,6 +27,8 @@ Patch0: 0001-PATCH-openmp-CMake-Make-LIBOMP_HEADERS_INSTALL_PATH-.patch
# the kmp_lock.cpp. Without this patch, GCC errors out with
# ../runtime/src/kmp_lock.cpp:2684:1: error: unsupported size for integer register
Patch1: gcc-workaround.patch
# https://github.com/llvm/llvm-project/commit/40d3a0ba4d9e5452c0a68cfdaa8e88eb8ed5c63d
Patch2: fix-strict-aliasing-issue-in-cmpxchg-routine.patch
BuildRequires: gcc
BuildRequires: gcc-c++
@ -166,6 +168,10 @@ cd %{_vpath_builddir}
%{_libexecdir}/tests/libomp/
%changelog
* Wed May 18 2022 Timm Bäder <tbaeder@redhat.com> - 14.00-2
- Backport 40d3a0ba4d9e5452c0a68cfdaa8e88eb8ed5c63d to
fix a strict aliasing issue.
* Thu Apr 07 2022 Timm Bäder <tbaeder@redhat.com> - 14.0.0-1
- Update to 14.0.0