>From 80f3757cb6fa6588928e778f7465e17959564a59 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Wed, 5 Jun 2013 14:03:41 +0200 Subject: [PATCH 1/2] rpm: Use hardened flags for RPM build https://fedorahosted.org/sssd/ticket/1797 This patch adds the _hardened_build macro on platforms where it is defined by the RPM. The macro amounts to compiling with cc --spec=/usr/lib/rpm/redhat/redhat-hardened-cc1 and then linking with ld --spec=/usr/lib/rpm/redhat/redhat-hardened-ld. On Fedora 19, the gcc spec files contain -z now and fPIC or fPIE. --- contrib/sssd.spec.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in index 65832166bc141ad37e5d24bf3ed969aef260fc66..c48a5de9095d50d2ac8856b45a8c2ed9b040f7bf 100644 --- a/contrib/sssd.spec.in +++ b/contrib/sssd.spec.in @@ -41,6 +41,10 @@ # Determine the location of the LDB modules directory %global ldb_modulesdir %(pkg-config --variable=modulesdir ldb) +%if (0%{?fedora} > 15 || 0%{?rhel} >= 7) +%define _hardened_build 1 +%endif + Name: @PACKAGE_NAME@ Version: @PACKAGE_VERSION@ Release: 0@PRERELEASE_VERSION@%{?dist} -- 1.8.2.1