diff options
Diffstat (limited to 'arch/sh/Makefile')
-rw-r--r-- | arch/sh/Makefile | 25 |
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,) \ | |||
35 | cflags-$(CONFIG_CPU_SH4AL_DSP) += $(call cc-option,-m4al,) | 35 | cflags-$(CONFIG_CPU_SH4AL_DSP) += $(call cc-option,-m4al,) |
36 | cflags-$(CONFIG_CPU_SH5) := $(call cc-option,-m5-32media-nofpu,) | 36 | cflags-$(CONFIG_CPU_SH5) := $(call cc-option,-m5-32media-nofpu,) |
37 | 37 | ||
38 | cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb | 38 | ifeq ($(cflags-y),) |
39 | cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml | 39 | # |
40 | 40 | # In the case where we are stuck with a compiler that has been uselessly | |
41 | cflags-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 | # | ||
48 | cflags-y += $(shell $(CC) $(KBUILD_CFLAGS) -print-multi-lib | \ | ||
49 | grep nofpu | sed q | sed -e 's/^/-/;s/;.*$$//') | ||
50 | # At this point, anything goes. | ||
51 | isaflags-y := $(call as-option,-Wa$(comma)-isa=any,) | ||
52 | else | ||
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 | ||
53 | isaflags-$(CONFIG_SH_DSP) := \ | 63 | isaflags-$(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) |
65 | endif | ||
66 | |||
67 | cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb | ||
68 | cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml | ||
55 | 69 | ||
70 | cflags-y += $(call cc-option,-mno-fdpic) | ||
56 | cflags-y += $(isaflags-y) -ffreestanding | 71 | cflags-y += $(isaflags-y) -ffreestanding |
57 | 72 | ||
58 | cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \ | 73 | cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \ |