Add -fno-openmp-implicit-rpath when building with clang

This prevents clang from adding RUNPATH for libomp.so to binaries built
with -fopenmp.

https://fedoraproject.org/wiki/Changes/Broken_RPATH_will_fail_rpmbuild
This commit is contained in:
Tom Stellard 2022-03-24 17:26:18 +00:00
parent 0478199b74
commit 0e07c90567
2 changed files with 7 additions and 2 deletions

4
macros
View File

@ -354,7 +354,9 @@ print(result)
# If they are needed then add "%define _legacy_common_support 1" to the spec file.
%_legacy_options %{?_legacy_common_support: -fcommon}
%__global_compiler_flags %{_general_options} %{_warning_options} %{_preprocessor_defines} %{_hardened_cflags} %{_annotation_cflags} %{_legacy_options}
%_clang_extra_flags --start-no-unused-arguments -fno-openmp-implicit-rpath --end-no-unused-arguments
%__global_compiler_flags %{_general_options} %{_warning_options} %{_preprocessor_defines} %{_hardened_cflags} %{_annotation_cflags} %{_legacy_options} %[ "%{toolchain}" == "clang" ? "%{_clang_extra_flags}" : "%{nil}" ]
# Automatically trim changelog entries after 2 years
%_changelog_trimage %{expr:2*365*24*60*60}

View File

@ -6,7 +6,7 @@
Summary: Red Hat specific rpm configuration files
Name: redhat-rpm-config
Version: 216
Version: 217
Release: 1%{?dist}
# No version specified.
License: GPL+
@ -215,6 +215,9 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora/srpm forge.lua
%doc buildflags.md
%changelog
* Tue Apr 19 2022 Tom Stellard <tstellar@redhat.com> - 217-1
- Add -fno-openmp-implicit-rpath when building with clang
* Wed Apr 13 2022 Nick Clifton <nickc@redhat.com> - 216-1
- Add support for comparing gcc-built and annobin-built plugins.