From 0e07c905671739a43018d9195f7cfc43dfecce93 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Thu, 24 Mar 2022 17:26:18 +0000 Subject: [PATCH] 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 --- macros | 4 +++- redhat-rpm-config.spec | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/macros b/macros index 2314c2a..f340a30 100644 --- a/macros +++ b/macros @@ -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} diff --git a/redhat-rpm-config.spec b/redhat-rpm-config.spec index b5f93d3..ba8f0c7 100644 --- a/redhat-rpm-config.spec +++ b/redhat-rpm-config.spec @@ -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 - 217-1 +- Add -fno-openmp-implicit-rpath when building with clang + * Wed Apr 13 2022 Nick Clifton - 216-1 - Add support for comparing gcc-built and annobin-built plugins.