From ca385d9198e98ad60a107a01594abd142bb62591 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 8 Aug 2011 10:59:25 -0400 Subject: [PATCH] redhat-hardened-{cc1,ld}: Move some of the rewrite magic to gcc specs so we don't end up with both -fPIC and -fPIE on the command line --- redhat-hardened-cc1 | 4 ++++ redhat-hardened-ld | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 redhat-hardened-cc1 create mode 100644 redhat-hardened-ld diff --git a/redhat-hardened-cc1 b/redhat-hardened-cc1 new file mode 100644 index 0000000..04b8f3c --- /dev/null +++ b/redhat-hardened-cc1 @@ -0,0 +1,4 @@ +%rename cc1_options rh_cc1_options_old + +*cc1_options: +%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIC}}}}} %(rh_cc1_options_old) diff --git a/redhat-hardened-ld b/redhat-hardened-ld new file mode 100644 index 0000000..b26049c --- /dev/null +++ b/redhat-hardened-ld @@ -0,0 +1,9 @@ +%rename self_spec rh_self_spec_old + +*self_spec: +%{!shared:-pie} %(rh_self_spec_old) + +%rename link rh_link_old + +*link: +-z now %(rh_link_old)