X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=arch%2Fsh%2FMakefile;h=3a74ed62ec89b846e2806daefad57eb7a4fbf8bc;hp=01d85c74481d9a42a066ecc9e8ecd0216621961a;hb=b2d86a3fd9855380598c0c039e712a20086e119f;hpb=ebdd90a8cb2e3963f55499850f02ce6003558b55 diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 01d85c74481d..3a74ed62ec89 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile @@ -2,7 +2,7 @@ # arch/sh/Makefile # # Copyright (C) 1999 Kaz Kojima -# Copyright (C) 2002, 2003, 2004 Paul Mundt +# Copyright (C) 2002 - 2008 Paul Mundt # Copyright (C) 2002 M. R. Brown # # This file is subject to the terms and conditions of the GNU General Public @@ -20,14 +20,6 @@ isa-$(CONFIG_CPU_SH4AL_DSP) := sh4al isa-$(CONFIG_CPU_SH5) := shmedia isa-$(CONFIG_SH_DSP) := $(isa-y)-dsp -ifndef CONFIG_SH_DSP -ifndef CONFIG_SH_FPU -isa-y := $(isa-y)-nofpu -endif -endif - -isa-y := $(isa-y)-up - cflags-$(CONFIG_CPU_SH2) := $(call cc-option,-m2,) cflags-$(CONFIG_CPU_SH2A) += $(call cc-option,-m2a,) \ $(call cc-option,-m2a-nofpu,) @@ -38,6 +30,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 +73,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 +85,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 +134,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/