[06/17] Allow overriding of CFLAGS as well as CPPFLAGS for rtld.

Message ID 1457882222-22599-7-git-send-email-nix@esperi.org.uk
State New, archived
Headers

Commit Message

Nix March 13, 2016, 3:16 p.m. UTC
  From: Nick Alcock <nick.alcock@oracle.com>

We need this to pass -fno-stack-protector to all the pieces of rtld in
non-elf/ directories.

	* elf/rtld-Rules (rtld-compile-command.c): Add $(rtld-CFLAGS).
	* scripts/sysd-rules.awk: Substitute in $(CFLAGS) as well as
	$(CPPFLAGS).
---
 elf/rtld-Rules         | 2 +-
 scripts/sysd-rules.awk | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
  

Comments

Roland McGrath April 4, 2016, 10:44 p.m. UTC | #1
This one change is certainly fine.
  
Mike Frysinger April 10, 2016, 3:53 a.m. UTC | #2
On 13 Mar 2016 15:16, Nix wrote:
> We need this to pass -fno-stack-protector to all the pieces of rtld in
> non-elf/ directories.

i've merged this, thanks
-mike
  

Patch

diff --git a/elf/rtld-Rules b/elf/rtld-Rules
index 94ca39b..c1bb506 100644
--- a/elf/rtld-Rules
+++ b/elf/rtld-Rules
@@ -90,7 +90,7 @@  else
 
 rtld-compile-command.S = $(compile-command.S) $(rtld-CPPFLAGS)
 rtld-compile-command.s = $(compile-command.s) $(rtld-CPPFLAGS)
-rtld-compile-command.c = $(compile-command.c) $(rtld-CPPFLAGS)
+rtld-compile-command.c = $(compile-command.c) $(rtld-CPPFLAGS) $(rtld-CFLAGS)
 
 # These are the basic compilation rules corresponding to the Makerules ones.
 # The sysd-rules generated makefile already defines pattern rules for rtld-%
diff --git a/scripts/sysd-rules.awk b/scripts/sysd-rules.awk
index cebc9d3..69af400 100644
--- a/scripts/sysd-rules.awk
+++ b/scripts/sysd-rules.awk
@@ -54,7 +54,7 @@  BEGIN {
           command_suffix = "";
         } else {
           prefix = gensub(/%/, "", 1, target_pattern);
-          command_suffix = " $(" prefix  "CPPFLAGS)";
+          command_suffix = " $(" prefix  "CPPFLAGS)" " $(" prefix  "CFLAGS)";
         }
         target = "$(objpfx)" target_pattern o ":";
         if (asm_rules) {