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>
This commit is contained in:
+16
-8
@@ -9,7 +9,7 @@
|
|||||||
UTS_MACHINE := arc
|
UTS_MACHINE := arc
|
||||||
|
|
||||||
ifeq ($(CROSS_COMPILE),)
|
ifeq ($(CROSS_COMPILE),)
|
||||||
CROSS_COMPILE := arc-elf32-
|
CROSS_COMPILE := arc-linux-uclibc-
|
||||||
endif
|
endif
|
||||||
|
|
||||||
KBUILD_DEFCONFIG := fpga_defconfig
|
KBUILD_DEFCONFIG := fpga_defconfig
|
||||||
@@ -25,7 +25,11 @@ ifdef CONFIG_ARC_CURR_IN_REG
|
|||||||
LINUXINCLUDE += -include ${src}/arch/arc/include/asm/current.h
|
LINUXINCLUDE += -include ${src}/arch/arc/include/asm/current.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
atleast_gcc44 := $(call cc-ifversion, -gt, 0402, y)
|
upto_gcc42 := $(call cc-ifversion, -le, 0402, y)
|
||||||
|
upto_gcc44 := $(call cc-ifversion, -le, 0404, y)
|
||||||
|
atleast_gcc44 := $(call cc-ifversion, -ge, 0404, y)
|
||||||
|
atleast_gcc48 := $(call cc-ifversion, -ge, 0408, y)
|
||||||
|
|
||||||
cflags-$(atleast_gcc44) += -fsection-anchors
|
cflags-$(atleast_gcc44) += -fsection-anchors
|
||||||
|
|
||||||
cflags-$(CONFIG_ARC_HAS_LLSC) += -mlock
|
cflags-$(CONFIG_ARC_HAS_LLSC) += -mlock
|
||||||
@@ -33,6 +37,11 @@ cflags-$(CONFIG_ARC_HAS_SWAPE) += -mswape
|
|||||||
cflags-$(CONFIG_ARC_HAS_RTSC) += -mrtsc
|
cflags-$(CONFIG_ARC_HAS_RTSC) += -mrtsc
|
||||||
cflags-$(CONFIG_ARC_DW2_UNWIND) += -fasynchronous-unwind-tables
|
cflags-$(CONFIG_ARC_DW2_UNWIND) += -fasynchronous-unwind-tables
|
||||||
|
|
||||||
|
# By default gcc 4.8 generates dwarf4 which kernel unwinder can't grok
|
||||||
|
ifeq ($(atleast_gcc48),y)
|
||||||
|
cflags-$(CONFIG_ARC_DW2_UNWIND) += -gdwarf-2
|
||||||
|
endif
|
||||||
|
|
||||||
ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE
|
ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE
|
||||||
# Generic build system uses -O2, we want -O3
|
# Generic build system uses -O2, we want -O3
|
||||||
cflags-y += -O3
|
cflags-y += -O3
|
||||||
@@ -46,11 +55,10 @@ cflags-$(disable_small_data) += -mno-sdata -fcall-used-gp
|
|||||||
cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mbig-endian
|
cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mbig-endian
|
||||||
ldflags-$(CONFIG_CPU_BIG_ENDIAN) += -EB
|
ldflags-$(CONFIG_CPU_BIG_ENDIAN) += -EB
|
||||||
|
|
||||||
# STAR 9000518362:
|
# STAR 9000518362: (fixed with binutils shipping with gcc 4.8)
|
||||||
# arc-linux-uclibc-ld (buildroot) or arceb-elf32-ld (EZChip) don't accept
|
# arc-linux-uclibc-ld (buildroot) or arceb-elf32-ld (EZChip) don't accept
|
||||||
# --build-id w/o "-marclinux".
|
# --build-id w/o "-marclinux". Default arc-elf32-ld is OK
|
||||||
# Default arc-elf32-ld is OK
|
ldflags-$(upto_gcc44) += -marclinux
|
||||||
ldflags-y += -marclinux
|
|
||||||
|
|
||||||
ARC_LIBGCC := -mA7
|
ARC_LIBGCC := -mA7
|
||||||
cflags-$(CONFIG_ARC_HAS_HW_MPY) += -multcost=16
|
cflags-$(CONFIG_ARC_HAS_HW_MPY) += -multcost=16
|
||||||
@@ -64,8 +72,8 @@ ifndef CONFIG_ARC_HAS_HW_MPY
|
|||||||
# With gcc 4.4.7, -mno-mpy is enough to make any other related adjustments,
|
# With gcc 4.4.7, -mno-mpy is enough to make any other related adjustments,
|
||||||
# e.g. increased cost of MPY. With gcc 4.2.1 this had to be explicitly hinted
|
# e.g. increased cost of MPY. With gcc 4.2.1 this had to be explicitly hinted
|
||||||
|
|
||||||
ARC_LIBGCC := -marc600
|
ifeq ($(upto_gcc42),y)
|
||||||
ifneq ($(atleast_gcc44),y)
|
ARC_LIBGCC := -marc600
|
||||||
cflags-y += -multcost=30
|
cflags-y += -multcost=30
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
CONFIG_CROSS_COMPILE="arc-elf32-"
|
CONFIG_CROSS_COMPILE="arc-linux-uclibc-"
|
||||||
# CONFIG_LOCALVERSION_AUTO is not set
|
# CONFIG_LOCALVERSION_AUTO is not set
|
||||||
CONFIG_DEFAULT_HOSTNAME="ARCLinux"
|
CONFIG_DEFAULT_HOSTNAME="ARCLinux"
|
||||||
# CONFIG_SWAP is not set
|
# CONFIG_SWAP is not set
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
CONFIG_CROSS_COMPILE="arc-elf32-"
|
CONFIG_CROSS_COMPILE="arc-linux-uclibc-"
|
||||||
# CONFIG_LOCALVERSION_AUTO is not set
|
# CONFIG_LOCALVERSION_AUTO is not set
|
||||||
CONFIG_DEFAULT_HOSTNAME="ARCLinux"
|
CONFIG_DEFAULT_HOSTNAME="ARCLinux"
|
||||||
# CONFIG_SWAP is not set
|
# CONFIG_SWAP is not set
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
CONFIG_CROSS_COMPILE="arc-elf32-"
|
CONFIG_CROSS_COMPILE="arc-linux-uclibc-"
|
||||||
# CONFIG_LOCALVERSION_AUTO is not set
|
# CONFIG_LOCALVERSION_AUTO is not set
|
||||||
CONFIG_DEFAULT_HOSTNAME="tb10x"
|
CONFIG_DEFAULT_HOSTNAME="tb10x"
|
||||||
CONFIG_SYSVIPC=y
|
CONFIG_SYSVIPC=y
|
||||||
|
|||||||
@@ -125,6 +125,11 @@ SECTIONS
|
|||||||
*(.debug_frame)
|
*(.debug_frame)
|
||||||
__end_unwind = .;
|
__end_unwind = .;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* gcc 4.8 generates this for -fasynchonous-unwind-tables,
|
||||||
|
* while we still use the .debug_frame based unwinder
|
||||||
|
*/
|
||||||
|
/DISCARD/ : { *(.eh_frame) }
|
||||||
#else
|
#else
|
||||||
/DISCARD/ : { *(.debug_frame) }
|
/DISCARD/ : { *(.debug_frame) }
|
||||||
#endif
|
#endif
|
||||||
@@ -142,15 +147,18 @@ SECTIONS
|
|||||||
*(.arcextmap.*)
|
*(.arcextmap.*)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef CONFIG_DEBUG_INFO
|
||||||
/* open-coded because we need .debug_frame seperately for unwinding */
|
/* open-coded because we need .debug_frame seperately for unwinding */
|
||||||
.debug_aranges 0 : { *(.debug_aranges) }
|
/DISCARD/ : { *(.debug_aranges) }
|
||||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
/DISCARD/ : { *(.debug_pubnames) }
|
||||||
.debug_info 0 : { *(.debug_info) }
|
/DISCARD/ : { *(.debug_info) }
|
||||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
/DISCARD/ : { *(.debug_abbrev) }
|
||||||
.debug_line 0 : { *(.debug_line) }
|
/DISCARD/ : { *(.debug_line) }
|
||||||
.debug_str 0 : { *(.debug_str) }
|
/DISCARD/ : { *(.debug_str) }
|
||||||
.debug_loc 0 : { *(.debug_loc) }
|
/DISCARD/ : { *(.debug_loc) }
|
||||||
.debug_macinfo 0 : { *(.debug_macinfo) }
|
/DISCARD/ : { *(.debug_macinfo) }
|
||||||
|
/DISCARD/ : { *(.debug_ranges) }
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_ARC_HAS_DCCM
|
#ifdef CONFIG_ARC_HAS_DCCM
|
||||||
. = CONFIG_ARC_DCCM_BASE;
|
. = CONFIG_ARC_DCCM_BASE;
|
||||||
|
|||||||
Reference in New Issue
Block a user