Build libomp with gcc again

@jchecahi@redhat.com Noticed that during the update from LLVM 14 to LLVM 15 several `__kmpc_atomic_*` functions got removed. According to @npopov@redhat.com this is a side-effect of building libomp with clang instead of gcc. That's why we decided to build libomp with gcc again instead of clang. libomp will only be used as a library by programs created with clang or gcc, hence the chosen compiler to build libomp itself matters less.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1988155

Resolves: rhbz#2118319
This commit is contained in:
Konrad Kleine 2022-10-28 13:26:51 +02:00
parent 29ac1d9758
commit 7b9ec042da
1 changed files with 10 additions and 2 deletions

View File

@ -1,4 +1,4 @@
%global toolchain clang
%global toolchain gcc
%global maj_ver 15
%global libomp_version %{maj_ver}.0.1
@ -14,7 +14,7 @@
Name: libomp
Version: %{libomp_version}%{?rc_ver:~rc%{rc_ver}}
Release: 1%{?dist}
Release: 2%{?dist}
Summary: OpenMP runtime for clang
License: NCSA
@ -75,6 +75,11 @@ OpenMP regression tests
%build
%if "%toolchain" == "gcc"
# Building openmp with LTO fails with GCC but works with Clang
%define _lto_cflags %{nil}
%endif
%cmake -GNinja \
-DLIBOMP_INSTALL_ALIASES=OFF \
-DCMAKE_MODULE_PATH=%{_libdir}/cmake/llvm \
@ -160,6 +165,9 @@ rm -rf %{buildroot}%{_libdir}/libarcher_static.a
%{_libexecdir}/tests/libomp/
%changelog
* Fri Oct 28 2022 Konrad Kleine <kkleine@redhat.com> - 15.0.1-2
- Build libomp runtime library with gcc
* Thu Sep 29 2022 Konrad Kleine <kkleine@redhat.com> - 15.0.1-1
- 15.0.1 Release