aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2013-05-25 04:33:25 -0400
committerVineet Gupta <vgupta@synopsys.com>2013-06-27 05:05:32 -0400
commit5a45da02cf040ae7eacc9da10f6e8e369a220863 (patch)
tree27e52dc1a1eda9c3508764bf0f3fcb5a085f43a5 /arch/arc
parent05b016ecf5e7a8c24409d8e9effb5d2ec9107708 (diff)
ARC: Adjustments for gcc 4.8
* DWARF unwinder related + Force DWARF2 compliant .debug_frame (gcc 4.8 defaults to DWARF4 which kernel unwinder can't grok). + Discard the additional .eh_frame generated + Discard the dwarf4 debug info generated by -gdwarf-2 for normal no debug case * 4.8 already uses arc600 multilibs for -mno-mpy * switch to using uclibc compiler (to get -mmedium-calls and -mno-sdata) and also since buildroot can only use 1 toolchain Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc')
-rw-r--r--arch/arc/Makefile24
-rw-r--r--arch/arc/configs/fpga_defconfig2
-rw-r--r--arch/arc/configs/nsimosci_defconfig2
-rw-r--r--arch/arc/configs/tb10x_defconfig2
-rw-r--r--arch/arc/kernel/vmlinux.lds.S24
5 files changed, 35 insertions, 19 deletions
diff --git a/arch/arc/Makefile b/arch/arc/Makefile
index fbc1b84e31f9..8c0b1aa56f7e 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -9,7 +9,7 @@
9UTS_MACHINE := arc 9UTS_MACHINE := arc
10 10
11ifeq ($(CROSS_COMPILE),) 11ifeq ($(CROSS_COMPILE),)
12CROSS_COMPILE := arc-elf32- 12CROSS_COMPILE := arc-linux-uclibc-
13endif 13endif
14 14
15KBUILD_DEFCONFIG := fpga_defconfig 15KBUILD_DEFCONFIG := fpga_defconfig
@@ -25,7 +25,11 @@ ifdef CONFIG_ARC_CURR_IN_REG
25LINUXINCLUDE += -include ${src}/arch/arc/include/asm/current.h 25LINUXINCLUDE += -include ${src}/arch/arc/include/asm/current.h
26endif 26endif
27 27
28atleast_gcc44 := $(call cc-ifversion, -gt, 0402, y) 28upto_gcc42 := $(call cc-ifversion, -le, 0402, y)
29upto_gcc44 := $(call cc-ifversion, -le, 0404, y)
30atleast_gcc44 := $(call cc-ifversion, -ge, 0404, y)
31atleast_gcc48 := $(call cc-ifversion, -ge, 0408, y)
32
29cflags-$(atleast_gcc44) += -fsection-anchors 33cflags-$(atleast_gcc44) += -fsection-anchors
30 34
31cflags-$(CONFIG_ARC_HAS_LLSC) += -mlock 35cflags-$(CONFIG_ARC_HAS_LLSC) += -mlock
@@ -33,6 +37,11 @@ cflags-$(CONFIG_ARC_HAS_SWAPE) += -mswape
33cflags-$(CONFIG_ARC_HAS_RTSC) += -mrtsc 37cflags-$(CONFIG_ARC_HAS_RTSC) += -mrtsc
34cflags-$(CONFIG_ARC_DW2_UNWIND) += -fasynchronous-unwind-tables 38cflags-$(CONFIG_ARC_DW2_UNWIND) += -fasynchronous-unwind-tables
35 39
40# By default gcc 4.8 generates dwarf4 which kernel unwinder can't grok
41ifeq ($(atleast_gcc48),y)
42cflags-$(CONFIG_ARC_DW2_UNWIND) += -gdwarf-2
43endif
44
36ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE 45ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE
37# Generic build system uses -O2, we want -O3 46# Generic build system uses -O2, we want -O3
38cflags-y += -O3 47cflags-y += -O3
@@ -46,11 +55,10 @@ cflags-$(disable_small_data) += -mno-sdata -fcall-used-gp
46cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mbig-endian 55cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mbig-endian
47ldflags-$(CONFIG_CPU_BIG_ENDIAN) += -EB 56ldflags-$(CONFIG_CPU_BIG_ENDIAN) += -EB
48 57
49# STAR 9000518362: 58# STAR 9000518362: (fixed with binutils shipping with gcc 4.8)
50# arc-linux-uclibc-ld (buildroot) or arceb-elf32-ld (EZChip) don't accept 59# arc-linux-uclibc-ld (buildroot) or arceb-elf32-ld (EZChip) don't accept
51# --build-id w/o "-marclinux". 60# --build-id w/o "-marclinux". Default arc-elf32-ld is OK
52# Default arc-elf32-ld is OK 61ldflags-$(upto_gcc44) += -marclinux
53ldflags-y += -marclinux
54 62
55ARC_LIBGCC := -mA7 63ARC_LIBGCC := -mA7
56cflags-$(CONFIG_ARC_HAS_HW_MPY) += -multcost=16 64cflags-$(CONFIG_ARC_HAS_HW_MPY) += -multcost=16
@@ -64,8 +72,8 @@ ifndef CONFIG_ARC_HAS_HW_MPY
64# With gcc 4.4.7, -mno-mpy is enough to make any other related adjustments, 72# With gcc 4.4.7, -mno-mpy is enough to make any other related adjustments,
65# e.g. increased cost of MPY. With gcc 4.2.1 this had to be explicitly hinted 73# e.g. increased cost of MPY. With gcc 4.2.1 this had to be explicitly hinted
66 74
67 ARC_LIBGCC := -marc600 75 ifeq ($(upto_gcc42),y)
68 ifneq ($(atleast_gcc44),y) 76 ARC_LIBGCC := -marc600
69 cflags-y += -multcost=30 77 cflags-y += -multcost=30
70 endif 78 endif
71endif 79endif
diff --git a/arch/arc/configs/fpga_defconfig b/arch/arc/configs/fpga_defconfig
index 95350be6ef6f..c109af320274 100644
--- a/arch/arc/configs/fpga_defconfig
+++ b/arch/arc/configs/fpga_defconfig
@@ -1,4 +1,4 @@
1CONFIG_CROSS_COMPILE="arc-elf32-" 1CONFIG_CROSS_COMPILE="arc-linux-uclibc-"
2# CONFIG_LOCALVERSION_AUTO is not set 2# CONFIG_LOCALVERSION_AUTO is not set
3CONFIG_DEFAULT_HOSTNAME="ARCLinux" 3CONFIG_DEFAULT_HOSTNAME="ARCLinux"
4# CONFIG_SWAP is not set 4# CONFIG_SWAP is not set
diff --git a/arch/arc/configs/nsimosci_defconfig b/arch/arc/configs/nsimosci_defconfig
index 446c96c24eff..451af30914f6 100644
--- a/arch/arc/configs/nsimosci_defconfig
+++ b/arch/arc/configs/nsimosci_defconfig
@@ -1,4 +1,4 @@
1CONFIG_CROSS_COMPILE="arc-elf32-" 1CONFIG_CROSS_COMPILE="arc-linux-uclibc-"
2# CONFIG_LOCALVERSION_AUTO is not set 2# CONFIG_LOCALVERSION_AUTO is not set
3CONFIG_DEFAULT_HOSTNAME="ARCLinux" 3CONFIG_DEFAULT_HOSTNAME="ARCLinux"
4# CONFIG_SWAP is not set 4# CONFIG_SWAP is not set
diff --git a/arch/arc/configs/tb10x_defconfig b/arch/arc/configs/tb10x_defconfig
index 4fa5cd9f2202..6be6492442d6 100644
--- a/arch/arc/configs/tb10x_defconfig
+++ b/arch/arc/configs/tb10x_defconfig
@@ -1,4 +1,4 @@
1CONFIG_CROSS_COMPILE="arc-elf32-" 1CONFIG_CROSS_COMPILE="arc-linux-uclibc-"
2# CONFIG_LOCALVERSION_AUTO is not set 2# CONFIG_LOCALVERSION_AUTO is not set
3CONFIG_DEFAULT_HOSTNAME="tb10x" 3CONFIG_DEFAULT_HOSTNAME="tb10x"
4CONFIG_SYSVIPC=y 4CONFIG_SYSVIPC=y
diff --git a/arch/arc/kernel/vmlinux.lds.S b/arch/arc/kernel/vmlinux.lds.S
index d3c92f52d444..2555f5886af6 100644
--- a/arch/arc/kernel/vmlinux.lds.S
+++ b/arch/arc/kernel/vmlinux.lds.S
@@ -125,6 +125,11 @@ SECTIONS
125 *(.debug_frame) 125 *(.debug_frame)
126 __end_unwind = .; 126 __end_unwind = .;
127 } 127 }
128 /*
129 * gcc 4.8 generates this for -fasynchonous-unwind-tables,
130 * while we still use the .debug_frame based unwinder
131 */
132 /DISCARD/ : { *(.eh_frame) }
128#else 133#else
129 /DISCARD/ : { *(.debug_frame) } 134 /DISCARD/ : { *(.debug_frame) }
130#endif 135#endif
@@ -142,15 +147,18 @@ SECTIONS
142 *(.arcextmap.*) 147 *(.arcextmap.*)
143 } 148 }
144 149
150#ifndef CONFIG_DEBUG_INFO
145 /* open-coded because we need .debug_frame seperately for unwinding */ 151 /* open-coded because we need .debug_frame seperately for unwinding */
146 .debug_aranges 0 : { *(.debug_aranges) } 152 /DISCARD/ : { *(.debug_aranges) }
147 .debug_pubnames 0 : { *(.debug_pubnames) } 153 /DISCARD/ : { *(.debug_pubnames) }
148 .debug_info 0 : { *(.debug_info) } 154 /DISCARD/ : { *(.debug_info) }
149 .debug_abbrev 0 : { *(.debug_abbrev) } 155 /DISCARD/ : { *(.debug_abbrev) }
150 .debug_line 0 : { *(.debug_line) } 156 /DISCARD/ : { *(.debug_line) }
151 .debug_str 0 : { *(.debug_str) } 157 /DISCARD/ : { *(.debug_str) }
152 .debug_loc 0 : { *(.debug_loc) } 158 /DISCARD/ : { *(.debug_loc) }
153 .debug_macinfo 0 : { *(.debug_macinfo) } 159 /DISCARD/ : { *(.debug_macinfo) }
160 /DISCARD/ : { *(.debug_ranges) }
161#endif
154 162
155#ifdef CONFIG_ARC_HAS_DCCM 163#ifdef CONFIG_ARC_HAS_DCCM
156 . = CONFIG_ARC_DCCM_BASE; 164 . = CONFIG_ARC_DCCM_BASE;