aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/Makefile')
-rw-r--r--arch/sh/Makefile33
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)
33cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \ 33cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \
34 $(call cc-option,-m4a-nofpu,) 34 $(call cc-option,-m4a-nofpu,)
35cflags-$(CONFIG_CPU_SH4AL_DSP) += $(call cc-option,-m4al,)
35cflags-$(CONFIG_CPU_SH5) := $(call cc-option,-m5-32media-nofpu,) 36cflags-$(CONFIG_CPU_SH5) := $(call cc-option,-m5-32media-nofpu,)
36 37
37ifeq ($(cflags-y),) 38ifeq ($(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#
49cflags-y += $(shell $(CC) $(KBUILD_CFLAGS) -print-multi-lib | \ 48cflags-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/;.*$$//')
51endif 50# At this point, anything goes.
52 51isaflags-y := $(call as-option,-Wa$(comma)-isa=any,)
53cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb 52else
54cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml
55
56cflags-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
68isaflags-$(CONFIG_SH_DSP) := \ 63isaflags-$(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)
65endif
70 66
67cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb
68cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml
69
70cflags-y += $(call cc-option,-mno-fdpic)
71cflags-y += $(isaflags-y) -ffreestanding 71cflags-y += $(isaflags-y) -ffreestanding
72 72
73cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \ 73cflags-$(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
80defaultimage-$(CONFIG_SUPERH32) := zImage 80defaultimage-$(CONFIG_SUPERH32) := zImage
81defaultimage-$(CONFIG_SH_SH7785LCR) := uImage 81defaultimage-$(CONFIG_SH_SH7785LCR) := uImage
82defaultimage-$(CONFIG_SH_RSK) := uImage
83defaultimage-$(CONFIG_SH_7206_SOLUTION_ENGINE) := vmlinux
84defaultimage-$(CONFIG_SH_7619_SOLUTION_ENGINE) := vmlinux
82 85
83# Set some sensible Kbuild defaults 86# Set some sensible Kbuild defaults
84KBUILD_DEFCONFIG := shx3_defconfig 87KBUILD_DEFCONFIG := shx3_defconfig
@@ -132,6 +135,7 @@ machdir-$(CONFIG_SH_LANDISK) += mach-landisk
132machdir-$(CONFIG_SH_TITAN) += mach-titan 135machdir-$(CONFIG_SH_TITAN) += mach-titan
133machdir-$(CONFIG_SH_LBOX_RE2) += mach-lboxre2 136machdir-$(CONFIG_SH_LBOX_RE2) += mach-lboxre2
134machdir-$(CONFIG_SH_CAYMAN) += mach-cayman 137machdir-$(CONFIG_SH_CAYMAN) += mach-cayman
138machdir-$(CONFIG_SH_RSK) += mach-rsk
135 139
136ifneq ($(machdir-y),) 140ifneq ($(machdir-y),)
137core-y += $(addprefix arch/sh/boards/, \ 141core-y += $(addprefix arch/sh/boards/, \
@@ -173,11 +177,8 @@ KBUILD_CFLAGS += -pipe $(cflags-y)
173KBUILD_CPPFLAGS += $(cflags-y) 177KBUILD_CPPFLAGS += $(cflags-y)
174KBUILD_AFLAGS += $(cflags-y) 178KBUILD_AFLAGS += $(cflags-y)
175 179
176LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
177
178libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y) 180libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y)
179libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) 181libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y)
180libs-y += $(LIBGCC)
181 182
182PHONY += maketools FORCE 183PHONY += maketools FORCE
183 184