From e9f95c5985bd0b3fa81a0dd75dc5a5b2fdb6220a Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Wed, 12 Apr 2023 12:13:02 +0200 Subject: [PATCH] Add RPM_LD_FLAGS to build environment Added in Fedora in 2011 to allow to %define _hardened_build 1 in one's specfile and have all the necessary gcc and ld flags configured in the common cases. See also rhbz#728974 and FESCO ticket 563 (https://pagure.io/fesco/issue/563) --- macros.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/macros.in b/macros.in index 4dc6e3ca3b..0b651bcbb6 100644 --- a/macros.in +++ b/macros.in @@ -752,11 +752,12 @@ Supplements: (%{name} = %{version}-%{release} and langpacks-%{1})\ RPM_SOURCE_DIR=\"%{_sourcedir}\"\ RPM_BUILD_DIR=\"%{_builddir}\"\ RPM_OPT_FLAGS=\"%{optflags}\"\ + RPM_LD_FLAGS=\"%{?build_ldflags}\"\ RPM_ARCH=\"%{_arch}\"\ RPM_OS=\"%{_os}\"\ RPM_BUILD_NCPUS=\"%{_smp_build_ncpus}\"\ RPM_SPECPARTS_DIR=\"%{specpartsdir}\"\ - export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS RPM_BUILD_NCPUS RPM_SPECPARTS_DIR\ + export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS RPM_BUILD_NCPUS RPM_SPECPARTS_DIR RPM_LD_FLAGS\ RPM_DOC_DIR=\"%{_docdir}\"\ export RPM_DOC_DIR\ RPM_PACKAGE_NAME=\"%{NAME}\"\