From: David Gibson Date: Tue, 29 May 2007 05:37:12 +0000 (+1000) Subject: [POWERPC] Don't use HOSTCFLAGS in BOOTCFLAGS X-Git-Tag: v2.6.22-rc4~12^2~6 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b610b9780bdb2750849f32c2eefef46af58c67f8;p=linux-2.6 [POWERPC] Don't use HOSTCFLAGS in BOOTCFLAGS In the bootwrapper code for powerpc, we include HOSTCFLAGS into the BOOTCFLAGS used for building the zImage wrapper code. Since the wrapper code is not host code, this makes no sense. This patch removes the use of HOSTCFLAGS here, instead including directly into BOOTCFLAGS those flags from the normal kernel CFLAGS which also make sense in the bootwrapper code. In particular, this makes the bootwrapper use -msoft-float, preventing the compiler from generating floating point instructions. Previously, under some circumstances the compiler could generate floating point instructions in the bootwrapper which would cause exceptions on embedded CPUS which don't have floating point support. Signed-off-by: David Gibson Acked-by: Josh Boyer Signed-off-by: Paul Mackerras --- diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index cc11697c38..ff2701949e 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -11,20 +11,18 @@ # bootloader and increase compatibility with OpenFirmware. # # To this end we need to define BOOTCC, etc, as the tools -# needed to build the 32 bit image. These are normally HOSTCC, -# but may be a third compiler if, for example, you are cross -# compiling from an intel box. Once the 64bit ppc gcc is -# stable it will probably simply be a compiler switch to -# compile for 32bit mode. +# needed to build the 32 bit image. That's normally the same +# compiler for the rest of the kernel, with the -m32 flag added. # To make it easier to setup a cross compiler, # CROSS32_COMPILE is setup as a prefix just like CROSS_COMPILE # in the toplevel makefile. all: $(obj)/zImage -HOSTCC := gcc -BOOTCFLAGS := $(HOSTCFLAGS) -fno-builtin -nostdinc -isystem \ - $(shell $(CROSS32CC) -print-file-name=include) -fPIC +BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ + -fno-strict-aliasing -Os -msoft-float -pipe \ + -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \ + -isystem $(shell $(CROSS32CC) -print-file-name=include) BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc ifeq ($(call cc-option-yn, -fstack-protector),y)