[patch] x86: add -freg-struct-return to CFLAGS

From: Ingo Molnar
Date: Thu Feb 22 2007 - 03:43:52 EST


Subject: [patch] x86: add -freg-struct-return to CFLAGS
From: Ingo Molnar <mingo@xxxxxxx>

Jeremy Fitzhardinge suggested the use of -freg-struct-return, which does
structure-returns (such as when using pte_t) in registers instead of on
the stack.

that is indeed so, and this option reduced the kernel size a bit:

text data bss dec hex filename
4799506 543456 3760128 9103090 8ae6f2 vmlinux.before
4798117 543456 3760128 9101701 8ae185 vmlinux.after

the resulting kernel booted fine on my testbox. Lets go for it.

Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
---
arch/i386/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux/arch/i386/Makefile
===================================================================
--- linux.orig/arch/i386/Makefile
+++ linux/arch/i386/Makefile
@@ -31,7 +31,7 @@ LDFLAGS_vmlinux := --emit-relocs
endif
CHECKFLAGS += -D__i386__

-CFLAGS += -pipe -msoft-float -mregparm=3
+CFLAGS += -pipe -msoft-float -mregparm=3 -freg-struct-return

# prevent gcc from keeping the stack 16 byte aligned
CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/