Patchwork Add *CFLAGS to LINK in rules.mak

login
register
mail settings
Submitter Peter Hjalmarsson
Date Oct. 24, 2009, 9:34 a.m.
Message ID <1256376842-8298-1-git-send-email-xake@rymdraket.net>
Download mbox | patch
Permalink /patch/36843/
State New
Headers show

Comments

Peter Hjalmarsson - Oct. 24, 2009, 9:34 a.m.
Sometimes when linking with gcc to get a predictable result you are suggested to also apply the compiler flags to the linker command.

For reference, please read:
http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Link-Options.html
---
 rules.mak |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/rules.mak b/rules.mak
index fa8bb6f..5d7e8bb 100644
--- a/rules.mak
+++ b/rules.mak
@@ -22,7 +22,7 @@  QEMU_CFLAGS += -MMD -MP -MT $@
 %.o: %.m
 	$(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) -c -o $@ $<,"  OBJC  $(TARGET_DIR)$@")
 
-LINK = $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $(1) $(ARLIBS_BEGIN) $(ARLIBS) $(ARLIBS_END) $(LIBS),"  LINK  $(TARGET_DIR)$@")
+LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(1) $(ARLIBS_BEGIN) $(ARLIBS) $(ARLIBS_END) $(LIBS),"  LINK  $(TARGET_DIR)$@")
 
 %$(EXESUF): %.o
 	$(call LINK,$^)