aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/Makefile')
-rw-r--r--arch/sh/Makefile25
1 files changed, 20 insertions, 5 deletions
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index fac1567b2afb..ad0096151781 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -35,11 +35,21 @@ cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \
35cflags-$(CONFIG_CPU_SH4AL_DSP) += $(call cc-option,-m4al,) 35cflags-$(CONFIG_CPU_SH4AL_DSP) += $(call cc-option,-m4al,)
36cflags-$(CONFIG_CPU_SH5) := $(call cc-option,-m5-32media-nofpu,) 36cflags-$(CONFIG_CPU_SH5) := $(call cc-option,-m5-32media-nofpu,)
37 37
38cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb 38ifeq ($(cflags-y),)
39cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml 39#
40 40# In the case where we are stuck with a compiler that has been uselessly
41cflags-y += $(call cc-option,-mno-fdpic) 41# restricted to a particular ISA, a favourite default of newer GCCs when
42 42# extensive multilib targets are not provided, ensure we get the best fit
43# regarding FP generation. This is intentionally stupid (albeit many
44# orders of magnitude less than GCC's default behaviour), as anything
45# with a large number of multilib targets better have been built
46# correctly for the target in mind.
47#
48cflags-y += $(shell $(CC) $(KBUILD_CFLAGS) -print-multi-lib | \
49 grep nofpu | sed q | sed -e 's/^/-/;s/;.*$$//')
50# At this point, anything goes.
51isaflags-y := $(call as-option,-Wa$(comma)-isa=any,)
52else
43# 53#
44# -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
45# 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
@@ -52,7 +62,12 @@ isaflags-y := $(call as-option,-Wa$(comma)-isa=$(isa-y),)
52 62
53isaflags-$(CONFIG_SH_DSP) := \ 63isaflags-$(CONFIG_SH_DSP) := \
54 $(call as-option,-Wa$(comma)-isa=$(isa-y),-Wa$(comma)-dsp) 64 $(call as-option,-Wa$(comma)-isa=$(isa-y),-Wa$(comma)-dsp)
65endif
66
67cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb
68cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml
55 69
70cflags-y += $(call cc-option,-mno-fdpic)
56cflags-y += $(isaflags-y) -ffreestanding 71cflags-y += $(isaflags-y) -ffreestanding
57 72
58cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \ 73cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \