Blame openmp-rpm/test.spec

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