diff options
Diffstat (limited to 'arch/arc/Makefile')
-rw-r--r-- | arch/arc/Makefile | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/arch/arc/Makefile b/arch/arc/Makefile index 183397fd289e..8c0b1aa56f7e 100644 --- a/arch/arc/Makefile +++ b/arch/arc/Makefile | |||
@@ -9,25 +9,27 @@ | |||
9 | UTS_MACHINE := arc | 9 | UTS_MACHINE := arc |
10 | 10 | ||
11 | ifeq ($(CROSS_COMPILE),) | 11 | ifeq ($(CROSS_COMPILE),) |
12 | CROSS_COMPILE := arc-elf32- | 12 | CROSS_COMPILE := arc-linux-uclibc- |
13 | endif | 13 | endif |
14 | 14 | ||
15 | KBUILD_DEFCONFIG := fpga_defconfig | 15 | KBUILD_DEFCONFIG := fpga_defconfig |
16 | 16 | ||
17 | cflags-y += -mA7 -fno-common -pipe -fno-builtin -D__linux__ | 17 | cflags-y += -mA7 -fno-common -pipe -fno-builtin -D__linux__ |
18 | 18 | ||
19 | LINUXINCLUDE += -include ${src}/arch/arc/include/asm/defines.h | ||
20 | |||
21 | ifdef CONFIG_ARC_CURR_IN_REG | 19 | ifdef CONFIG_ARC_CURR_IN_REG |
22 | # For a global register defintion, make sure it gets passed to every file | 20 | # For a global register defintion, make sure it gets passed to every file |
23 | # We had a customer reported bug where some code built in kernel was NOT using | 21 | # We had a customer reported bug where some code built in kernel was NOT using |
24 | # any kernel headers, and missing the r25 global register | 22 | # any kernel headers, and missing the r25 global register |
25 | # Can't do unconditionally (like above) because of recursive include issues | 23 | # Can't do unconditionally because of recursive include issues |
26 | # due to <linux/thread_info.h> | 24 | # due to <linux/thread_info.h> |
27 | LINUXINCLUDE += -include ${src}/arch/arc/include/asm/current.h | 25 | LINUXINCLUDE += -include ${src}/arch/arc/include/asm/current.h |
28 | endif | 26 | endif |
29 | 27 | ||
30 | atleast_gcc44 := $(call cc-ifversion, -gt, 0402, y) | 28 | upto_gcc42 := $(call cc-ifversion, -le, 0402, y) |
29 | upto_gcc44 := $(call cc-ifversion, -le, 0404, y) | ||
30 | atleast_gcc44 := $(call cc-ifversion, -ge, 0404, y) | ||
31 | atleast_gcc48 := $(call cc-ifversion, -ge, 0408, y) | ||
32 | |||
31 | cflags-$(atleast_gcc44) += -fsection-anchors | 33 | cflags-$(atleast_gcc44) += -fsection-anchors |
32 | 34 | ||
33 | cflags-$(CONFIG_ARC_HAS_LLSC) += -mlock | 35 | cflags-$(CONFIG_ARC_HAS_LLSC) += -mlock |
@@ -35,6 +37,11 @@ cflags-$(CONFIG_ARC_HAS_SWAPE) += -mswape | |||
35 | cflags-$(CONFIG_ARC_HAS_RTSC) += -mrtsc | 37 | cflags-$(CONFIG_ARC_HAS_RTSC) += -mrtsc |
36 | cflags-$(CONFIG_ARC_DW2_UNWIND) += -fasynchronous-unwind-tables | 38 | cflags-$(CONFIG_ARC_DW2_UNWIND) += -fasynchronous-unwind-tables |
37 | 39 | ||
40 | # By default gcc 4.8 generates dwarf4 which kernel unwinder can't grok | ||
41 | ifeq ($(atleast_gcc48),y) | ||
42 | cflags-$(CONFIG_ARC_DW2_UNWIND) += -gdwarf-2 | ||
43 | endif | ||
44 | |||
38 | ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE | 45 | ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE |
39 | # Generic build system uses -O2, we want -O3 | 46 | # Generic build system uses -O2, we want -O3 |
40 | cflags-y += -O3 | 47 | cflags-y += -O3 |
@@ -48,11 +55,10 @@ cflags-$(disable_small_data) += -mno-sdata -fcall-used-gp | |||
48 | cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mbig-endian | 55 | cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mbig-endian |
49 | ldflags-$(CONFIG_CPU_BIG_ENDIAN) += -EB | 56 | ldflags-$(CONFIG_CPU_BIG_ENDIAN) += -EB |
50 | 57 | ||
51 | # STAR 9000518362: | 58 | # STAR 9000518362: (fixed with binutils shipping with gcc 4.8) |
52 | # 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 |
53 | # --build-id w/o "-marclinux". | 60 | # --build-id w/o "-marclinux". Default arc-elf32-ld is OK |
54 | # Default arc-elf32-ld is OK | 61 | ldflags-$(upto_gcc44) += -marclinux |
55 | ldflags-y += -marclinux | ||
56 | 62 | ||
57 | ARC_LIBGCC := -mA7 | 63 | ARC_LIBGCC := -mA7 |
58 | cflags-$(CONFIG_ARC_HAS_HW_MPY) += -multcost=16 | 64 | cflags-$(CONFIG_ARC_HAS_HW_MPY) += -multcost=16 |
@@ -66,8 +72,8 @@ ifndef CONFIG_ARC_HAS_HW_MPY | |||
66 | # 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, |
67 | # 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 |
68 | 74 | ||
69 | ARC_LIBGCC := -marc600 | 75 | ifeq ($(upto_gcc42),y) |
70 | ifneq ($(atleast_gcc44),y) | 76 | ARC_LIBGCC := -marc600 |
71 | cflags-y += -multcost=30 | 77 | cflags-y += -multcost=30 |
72 | endif | 78 | endif |
73 | endif | 79 | endif |