diff options
Diffstat (limited to 'arch/sh/Makefile')
-rw-r--r-- | arch/sh/Makefile | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 1f409bf81809..3b2d8e232240 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile | |||
@@ -38,6 +38,22 @@ cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \ | |||
38 | $(call cc-option,-m4a-nofpu,) | 38 | $(call cc-option,-m4a-nofpu,) |
39 | cflags-$(CONFIG_CPU_SH5) := $(call cc-option,-m5-32media-nofpu,) | 39 | cflags-$(CONFIG_CPU_SH5) := $(call cc-option,-m5-32media-nofpu,) |
40 | 40 | ||
41 | ifeq ($(cflags-y),) | ||
42 | # | ||
43 | # In the case where we are stuck with a compiler that has been uselessly | ||
44 | # restricted to a particular ISA, a favourite default of newer GCCs when | ||
45 | # extensive multilib targets are not provided, ensure we get the best fit | ||
46 | # regarding FP generation. This is necessary to avoid references to FP | ||
47 | # variants in libgcc where integer variants exist, which otherwise result | ||
48 | # in link errors. This is intentionally stupid (albeit many orders of | ||
49 | # magnitude less than GCC's default behaviour), as anything with a large | ||
50 | # number of multilib targets better have been built correctly for | ||
51 | # the target in mind. | ||
52 | # | ||
53 | cflags-y += $(shell $(CC) $(KBUILD_CFLAGS) -print-multi-lib | \ | ||
54 | grep nofpu | sed q | sed -e 's/^/-/;s/;.*$$//') | ||
55 | endif | ||
56 | |||
41 | cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb | 57 | cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb |
42 | cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml | 58 | cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml |
43 | 59 | ||