diff options
author | Andi Kleen <ak@suse.de> | 2006-09-26 04:52:30 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-09-26 04:52:30 -0400 |
commit | e2414910f212c52d9d7c64c99a22863488ac5b48 (patch) | |
tree | 5a7e55191ace4aa755c0684bcefc9cf1b124128c /arch | |
parent | fe7414a2882c953788af13a7f2c9d570ed8f71c5 (diff) |
[PATCH] x86: Detect CFI support in the assembler at runtime
... instead of using a CONFIG option. The config option still controls
if the resulting executable actually has unwind information.
This is useful to prevent compilation errors when users select
CONFIG_STACK_UNWIND on old binutils and also allows to use
CFI in the future for non kernel debugging applications.
Cc: jbeulich@novell.com
Cc: sam@ravnborg.org
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 | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/arch/i386/Makefile b/arch/i386/Makefile index 3e4adb1e2244..508cdbeb3a09 100644 --- a/arch/i386/Makefile +++ b/arch/i386/Makefile | |||
@@ -46,6 +46,10 @@ cflags-y += -ffreestanding | |||
46 | # a lot more stack due to the lack of sharing of stacklots: | 46 | # 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 ;) | 47 | CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then echo $(call cc-option,-fno-unit-at-a-time); fi ;) |
48 | 48 | ||
49 | # do binutils support CFI? | ||
50 | cflags-y += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,) | ||
51 | AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,) | ||
52 | |||
49 | CFLAGS += $(cflags-y) | 53 | CFLAGS += $(cflags-y) |
50 | 54 | ||
51 | # Default subarch .c files | 55 | # Default subarch .c files |
diff --git a/arch/x86_64/Makefile b/arch/x86_64/Makefile index 431bb4bc36cd..d6472ddf5f6e 100644 --- a/arch/x86_64/Makefile +++ b/arch/x86_64/Makefile | |||
@@ -54,6 +54,9 @@ 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 | # do binutils support CFI? | ||
58 | 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,) | ||
57 | 60 | ||
58 | CFLAGS += $(cflags-y) | 61 | CFLAGS += $(cflags-y) |
59 | CFLAGS_KERNEL += $(cflags-kernel-y) | 62 | CFLAGS_KERNEL += $(cflags-kernel-y) |