clang/tests/openmp-rpm/test.spec
Timm Bäder 94e3ce033b Update to 14.0.5
Resolves: rhbz#2061056
Resolves: rhbz#2061055

Update tests from Fedora repo
2022-06-21 08:48:21 +02:00

37 lines
841 B
RPMSpec

%global toolchain clang
%{?scl:%global scl_prefix %{scl}-}
Name: test
Version: 1
Release: 1
Summary: Test package for checking that RPM packages using -fopenmp build correctly
License: MIT
BuildRequires: %{?scl_prefix}clang
BuildRequires: %{?scl_prefix}libomp
Source0: test.c
%description
clang was adding RUNPATH to binaries that use OpenMP, and since RUNPATH
is prohibited in Fedora builds, this was causing packages using clang
and OpenMP to fail to build.
References:
https://fedoraproject.org/wiki/Changes/Broken_RPATH_will_fail_rpmbuild
https://github.com/llvm/llvm-project/commit/9b9d08111b618d74574ba03e5cc3d752ecc56f55
%build
clang ${CFLAGS} -c %{SOURCE0} -o test.o
clang ${LDFLAGS} -fopenmp test.o -o main
%check
./main
%install
install -d %{buildroot}%{_bindir}
install main %{buildroot}%{_bindir}
%files
%{_bindir}/main