sh: sh7785lcr: Select uImage as default image target.
[pandora-kernel.git] / arch / sh / Makefile
index 01d85c7..240ad6b 100644 (file)
@@ -38,6 +38,22 @@ cflags-$(CONFIG_CPU_SH4A)            += $(call cc-option,-m4a,) \
                                           $(call cc-option,-m4a-nofpu,)
 cflags-$(CONFIG_CPU_SH5)               := $(call cc-option,-m5-32media-nofpu,)
 
+ifeq ($(cflags-y),)
+#
+# In the case where we are stuck with a compiler that has been uselessly
+# restricted to a particular ISA, a favourite default of newer GCCs when
+# extensive multilib targets are not provided, ensure we get the best fit
+# regarding FP generation. This is necessary to avoid references to FP
+# variants in libgcc where integer variants exist, which otherwise result
+# in link errors. This is intentionally stupid (albeit many orders of
+# magnitude less than GCC's default behaviour), as anything with a large
+# number of multilib targets better have been built correctly for
+# the target in mind.
+#
+cflags-y       += $(shell $(CC) $(KBUILD_CFLAGS) -print-multi-lib | \
+                    grep nofpu | sed q | sed -e 's/^/-/;s/;.*$$//')
+endif
+
 cflags-$(CONFIG_CPU_BIG_ENDIAN)                += -mb
 cflags-$(CONFIG_CPU_LITTLE_ENDIAN)     += -ml
 
@@ -65,7 +81,8 @@ OBJCOPYFLAGS  := -O binary -R .note -R .note.gnu.build-id -R .comment \
                   -R .stab -R .stabstr -S
 
 # Give the various platforms the opportunity to set default image types
-defaultimage-$(CONFIG_SUPERH32)        := zImage
+defaultimage-$(CONFIG_SUPERH32)                        := zImage
+defaultimage-$(CONFIG_SH_SH7785LCR)            := uImage
 
 # Set some sensible Kbuild defaults
 KBUILD_DEFCONFIG       := shx3_defconfig
@@ -76,8 +93,10 @@ KBUILD_IMAGE         := $(defaultimage-y)
 # error messages during linking.
 #
 ifdef CONFIG_SUPERH32
+UTS_MACHINE    := sh
 LDFLAGS_vmlinux        += -e _stext
 else
+UTS_MACHINE    := sh64
 LDFLAGS_vmlinux        += --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \
                   --defsym phys_stext_shmedia=phys_stext+1 \
                   -e phys_stext_shmedia
@@ -123,6 +142,9 @@ core-y      += $(addprefix arch/sh/boards/, \
             $(filter-out ., $(patsubst %,%/,$(machdir-y))))
 endif
 
+# Common machine type headers. Not part of the arch/sh/boards/ hierarchy.
+machdir-y      += mach-common
+
 # Companion chips
 core-$(CONFIG_HD6446X_SERIES)  += arch/sh/cchips/hd6446x/