diff options
author | Andi Kleen <ak@suse.de> | 2006-10-21 12:37:01 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-10-21 12:37:01 -0400 |
commit | cdfce1f5714fec7b24715f569b2fee1607350a6d (patch) | |
tree | a5f3a8123825504feede111f43f5294d90fd12be /arch | |
parent | 73bb8919b33d42cf75a0ed89bc9ca6a7128665be (diff) |
[PATCH] x86: Use -maccumulate-outgoing-args
This avoids some problems with gcc 4.x and earlier generating
invalid unwind information. In 4.1 the option is default
when unwind information is enabled.
And it seems to generate smaller code too, so it's probably
a good thing on its own. With gcc 4.0:
i386:
4683198 902112 480868 6066178 5c9002 vmlinux (before)
4449895 902112 480868 5832875 5900ab vmlinux (after)
x86-64:
4939761 1449584 648216 7037561 6b6279 vmlinux (before)
4854193 1449584 648216 6951993 6a1439 vmlinux (after)
On 4.1 it shouldn't make much difference because it is
default when unwind is enabled anyways.
Suggested by Michael Matz and Jan Beulich
Cc: jbeulich@novell.com
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/Makefile | 4 | ||||
-rw-r--r-- | arch/x86_64/Makefile | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/arch/i386/Makefile b/arch/i386/Makefile index 2d9d756fdd74..0677908dfa06 100644 --- a/arch/i386/Makefile +++ b/arch/i386/Makefile | |||
@@ -42,6 +42,10 @@ cflags-$(CONFIG_REGPARM) += -mregparm=3 | |||
42 | # temporary until string.h is fixed | 42 | # temporary until string.h is fixed |
43 | cflags-y += -ffreestanding | 43 | cflags-y += -ffreestanding |
44 | 44 | ||
45 | # this works around some issues with generating unwind tables in older gccs | ||
46 | # newer gccs do it by default | ||
47 | cflags-y += -maccumulate-outgoing-args | ||
48 | |||
45 | # Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use | 49 | # Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use |
46 | # a lot more stack due to the lack of sharing of stacklots: | 50 | # a lot more stack due to the lack of sharing of stacklots: |
47 | CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then echo $(call cc-option,-fno-unit-at-a-time); fi ;) | 51 | CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then echo $(call cc-option,-fno-unit-at-a-time); fi ;) |
diff --git a/arch/x86_64/Makefile b/arch/x86_64/Makefile index 1c0f18d4f887..13972148058d 100644 --- a/arch/x86_64/Makefile +++ b/arch/x86_64/Makefile | |||
@@ -54,6 +54,10 @@ endif | |||
54 | cflags-y += $(call cc-option,-funit-at-a-time) | 54 | cflags-y += $(call cc-option,-funit-at-a-time) |
55 | # prevent gcc from generating any FP code by mistake | 55 | # prevent gcc from generating any FP code by mistake |
56 | cflags-y += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,) | 56 | cflags-y += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,) |
57 | # this works around some issues with generating unwind tables in older gccs | ||
58 | # newer gccs do it by default | ||
59 | cflags-y += -maccumulate-outgoing-args | ||
60 | |||
57 | # do binutils support CFI? | 61 | # do binutils support CFI? |
58 | cflags-y += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,) | 62 | cflags-y += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,) |
59 | AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,) | 63 | AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,) |