]> Pileus Git - ~andy/linux/commitdiff
ARC: Adjustments for gcc 4.8
authorVineet Gupta <vgupta@synopsys.com>
Sat, 25 May 2013 08:33:25 +0000 (14:03 +0530)
committerVineet Gupta <vgupta@synopsys.com>
Thu, 27 Jun 2013 09:05:32 +0000 (14:35 +0530)
* 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>
arch/arc/Makefile
arch/arc/configs/fpga_defconfig
arch/arc/configs/nsimosci_defconfig
arch/arc/configs/tb10x_defconfig
arch/arc/kernel/vmlinux.lds.S

index fbc1b84e31f90eab582158e1ca0c221d646e2bb4..8c0b1aa56f7ef0f885bb51a94ff6291c867bbf82 100644 (file)
@@ -9,7 +9,7 @@
 UTS_MACHINE := arc
 
 ifeq ($(CROSS_COMPILE),)
-CROSS_COMPILE := arc-elf32-
+CROSS_COMPILE := arc-linux-uclibc-
 endif
 
 KBUILD_DEFCONFIG := fpga_defconfig
@@ -25,7 +25,11 @@ ifdef CONFIG_ARC_CURR_IN_REG
 LINUXINCLUDE   +=  -include ${src}/arch/arc/include/asm/current.h
 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-$(CONFIG_ARC_HAS_LLSC)          += -mlock
@@ -33,6 +37,11 @@ cflags-$(CONFIG_ARC_HAS_SWAPE)               += -mswape
 cflags-$(CONFIG_ARC_HAS_RTSC)          += -mrtsc
 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
 # Generic build system uses -O2, we want -O3
 cflags-y  += -O3
@@ -46,11 +55,10 @@ cflags-$(disable_small_data)                += -mno-sdata -fcall-used-gp
 cflags-$(CONFIG_CPU_BIG_ENDIAN)                += -mbig-endian
 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
-# --build-id w/o "-marclinux".
-# Default arc-elf32-ld is OK
-ldflags-y                              += -marclinux
+# --build-id w/o "-marclinux". Default arc-elf32-ld is OK
+ldflags-$(upto_gcc44)                  += -marclinux
 
 ARC_LIBGCC                             := -mA7
 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,
 # e.g. increased cost of MPY. With gcc 4.2.1 this had to be explicitly hinted
 
-       ARC_LIBGCC              := -marc600
-       ifneq ($(atleast_gcc44),y)
+       ifeq ($(upto_gcc42),y)
+               ARC_LIBGCC      := -marc600
                cflags-y        += -multcost=30
        endif
 endif
index 95350be6ef6f5cd96685878ab081f320eafd3bd8..c109af320274f30665548463a07617b242d3279c 100644 (file)
@@ -1,4 +1,4 @@
-CONFIG_CROSS_COMPILE="arc-elf32-"
+CONFIG_CROSS_COMPILE="arc-linux-uclibc-"
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_DEFAULT_HOSTNAME="ARCLinux"
 # CONFIG_SWAP is not set
index 446c96c24eff59f17678f5fcc8382e13ed69d4ba..451af30914f660e14f81a6779292ca56d3c3ec99 100644 (file)
@@ -1,4 +1,4 @@
-CONFIG_CROSS_COMPILE="arc-elf32-"
+CONFIG_CROSS_COMPILE="arc-linux-uclibc-"
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_DEFAULT_HOSTNAME="ARCLinux"
 # CONFIG_SWAP is not set
index 4fa5cd9f22028bab678371baa14cf9f3ac0ce01d..6be6492442d640d3aba09b42239650995aa6e5be 100644 (file)
@@ -1,4 +1,4 @@
-CONFIG_CROSS_COMPILE="arc-elf32-"
+CONFIG_CROSS_COMPILE="arc-linux-uclibc-"
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_DEFAULT_HOSTNAME="tb10x"
 CONFIG_SYSVIPC=y
index d3c92f52d4442452cb3a682f00276f9c330c7ed5..2555f5886af624dc508354e2938ca32b4373d450 100644 (file)
@@ -125,6 +125,11 @@ SECTIONS
                *(.debug_frame)
                __end_unwind = .;
        }
+       /*
+        * gcc 4.8 generates this for -fasynchonous-unwind-tables,
+        * while we still use the .debug_frame based unwinder
+        */
+       /DISCARD/ : {   *(.eh_frame) }
 #else
        /DISCARD/ : {   *(.debug_frame) }
 #endif
@@ -142,15 +147,18 @@ SECTIONS
                *(.arcextmap.*)
        }
 
+#ifndef CONFIG_DEBUG_INFO
        /* open-coded because we need .debug_frame seperately for unwinding */
-       .debug_aranges 0 : { *(.debug_aranges) }
-       .debug_pubnames 0 : { *(.debug_pubnames) }
-       .debug_info 0 : { *(.debug_info) }
-       .debug_abbrev 0 : { *(.debug_abbrev) }
-       .debug_line 0 : { *(.debug_line) }
-       .debug_str 0 : { *(.debug_str) }
-       .debug_loc 0 : { *(.debug_loc) }
-       .debug_macinfo 0 : { *(.debug_macinfo) }
+       /DISCARD/ : { *(.debug_aranges) }
+       /DISCARD/ : { *(.debug_pubnames) }
+       /DISCARD/ : { *(.debug_info) }
+       /DISCARD/ : { *(.debug_abbrev) }
+       /DISCARD/ : { *(.debug_line) }
+       /DISCARD/ : { *(.debug_str) }
+       /DISCARD/ : { *(.debug_loc) }
+       /DISCARD/ : { *(.debug_macinfo) }
+       /DISCARD/ : { *(.debug_ranges) }
+#endif
 
 #ifdef CONFIG_ARC_HAS_DCCM
        . = CONFIG_ARC_DCCM_BASE;