diff options
Diffstat (limited to 'arch/sh/Makefile')
-rw-r--r-- | arch/sh/Makefile | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/arch/sh/Makefile b/arch/sh/Makefile index c43eb0d7fa3b..4067b0d9287b 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile | |||
@@ -32,6 +32,7 @@ cflags-$(CONFIG_CPU_SH4) := $(call cc-option,-m4,) \ | |||
32 | $(call cc-option,-mno-implicit-fp,-m4-nofpu) | 32 | $(call cc-option,-mno-implicit-fp,-m4-nofpu) |
33 | cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \ | 33 | cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \ |
34 | $(call cc-option,-m4a-nofpu,) | 34 | $(call cc-option,-m4a-nofpu,) |
35 | cflags-$(CONFIG_CPU_SH4AL_DSP) += $(call cc-option,-m4al,) | ||
35 | cflags-$(CONFIG_CPU_SH5) := $(call cc-option,-m5-32media-nofpu,) | 36 | cflags-$(CONFIG_CPU_SH5) := $(call cc-option,-m5-32media-nofpu,) |
36 | 37 | ||
37 | ifeq ($(cflags-y),) | 38 | ifeq ($(cflags-y),) |
@@ -39,22 +40,16 @@ ifeq ($(cflags-y),) | |||
39 | # In the case where we are stuck with a compiler that has been uselessly | 40 | # In the case where we are stuck with a compiler that has been uselessly |
40 | # restricted to a particular ISA, a favourite default of newer GCCs when | 41 | # restricted to a particular ISA, a favourite default of newer GCCs when |
41 | # extensive multilib targets are not provided, ensure we get the best fit | 42 | # extensive multilib targets are not provided, ensure we get the best fit |
42 | # regarding FP generation. This is necessary to avoid references to FP | 43 | # regarding FP generation. This is intentionally stupid (albeit many |
43 | # variants in libgcc where integer variants exist, which otherwise result | 44 | # orders of magnitude less than GCC's default behaviour), as anything |
44 | # in link errors. This is intentionally stupid (albeit many orders of | 45 | # with a large number of multilib targets better have been built |
45 | # magnitude less than GCC's default behaviour), as anything with a large | 46 | # correctly for the target in mind. |
46 | # number of multilib targets better have been built correctly for | ||
47 | # the target in mind. | ||
48 | # | 47 | # |
49 | cflags-y += $(shell $(CC) $(KBUILD_CFLAGS) -print-multi-lib | \ | 48 | cflags-y += $(shell $(CC) $(KBUILD_CFLAGS) -print-multi-lib | \ |
50 | grep nofpu | sed q | sed -e 's/^/-/;s/;.*$$//') | 49 | grep nofpu | sed q | sed -e 's/^/-/;s/;.*$$//') |
51 | endif | 50 | # At this point, anything goes. |
52 | 51 | isaflags-y := $(call as-option,-Wa$(comma)-isa=any,) | |
53 | cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb | 52 | else |
54 | cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml | ||
55 | |||
56 | cflags-y += $(call cc-option,-mno-fdpic) | ||
57 | |||
58 | # | 53 | # |
59 | # -Wa,-isa= tuning implies -Wa,-dsp for the versions of binutils that | 54 | # -Wa,-isa= tuning implies -Wa,-dsp for the versions of binutils that |
60 | # support it, while -Wa,-dsp by itself limits the range of usable opcodes | 55 | # support it, while -Wa,-dsp by itself limits the range of usable opcodes |
@@ -67,7 +62,12 @@ isaflags-y := $(call as-option,-Wa$(comma)-isa=$(isa-y),) | |||
67 | 62 | ||
68 | isaflags-$(CONFIG_SH_DSP) := \ | 63 | isaflags-$(CONFIG_SH_DSP) := \ |
69 | $(call as-option,-Wa$(comma)-isa=$(isa-y),-Wa$(comma)-dsp) | 64 | $(call as-option,-Wa$(comma)-isa=$(isa-y),-Wa$(comma)-dsp) |
65 | endif | ||
70 | 66 | ||
67 | cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb | ||
68 | cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml | ||
69 | |||
70 | cflags-y += $(call cc-option,-mno-fdpic) | ||
71 | cflags-y += $(isaflags-y) -ffreestanding | 71 | cflags-y += $(isaflags-y) -ffreestanding |
72 | 72 | ||
73 | cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \ | 73 | cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \ |
@@ -79,6 +79,9 @@ OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment \ | |||
79 | # Give the various platforms the opportunity to set default image types | 79 | # Give the various platforms the opportunity to set default image types |
80 | defaultimage-$(CONFIG_SUPERH32) := zImage | 80 | defaultimage-$(CONFIG_SUPERH32) := zImage |
81 | defaultimage-$(CONFIG_SH_SH7785LCR) := uImage | 81 | defaultimage-$(CONFIG_SH_SH7785LCR) := uImage |
82 | defaultimage-$(CONFIG_SH_RSK) := uImage | ||
83 | defaultimage-$(CONFIG_SH_7206_SOLUTION_ENGINE) := vmlinux | ||
84 | defaultimage-$(CONFIG_SH_7619_SOLUTION_ENGINE) := vmlinux | ||
82 | 85 | ||
83 | # Set some sensible Kbuild defaults | 86 | # Set some sensible Kbuild defaults |
84 | KBUILD_DEFCONFIG := shx3_defconfig | 87 | KBUILD_DEFCONFIG := shx3_defconfig |
@@ -132,6 +135,7 @@ machdir-$(CONFIG_SH_LANDISK) += mach-landisk | |||
132 | machdir-$(CONFIG_SH_TITAN) += mach-titan | 135 | machdir-$(CONFIG_SH_TITAN) += mach-titan |
133 | machdir-$(CONFIG_SH_LBOX_RE2) += mach-lboxre2 | 136 | machdir-$(CONFIG_SH_LBOX_RE2) += mach-lboxre2 |
134 | machdir-$(CONFIG_SH_CAYMAN) += mach-cayman | 137 | machdir-$(CONFIG_SH_CAYMAN) += mach-cayman |
138 | machdir-$(CONFIG_SH_RSK) += mach-rsk | ||
135 | 139 | ||
136 | ifneq ($(machdir-y),) | 140 | ifneq ($(machdir-y),) |
137 | core-y += $(addprefix arch/sh/boards/, \ | 141 | core-y += $(addprefix arch/sh/boards/, \ |
@@ -173,11 +177,8 @@ KBUILD_CFLAGS += -pipe $(cflags-y) | |||
173 | KBUILD_CPPFLAGS += $(cflags-y) | 177 | KBUILD_CPPFLAGS += $(cflags-y) |
174 | KBUILD_AFLAGS += $(cflags-y) | 178 | KBUILD_AFLAGS += $(cflags-y) |
175 | 179 | ||
176 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) | ||
177 | |||
178 | libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y) | 180 | libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y) |
179 | libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) | 181 | libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) |
180 | libs-y += $(LIBGCC) | ||
181 | 182 | ||
182 | PHONY += maketools FORCE | 183 | PHONY += maketools FORCE |
183 | 184 | ||