Don't use HOSTCFLAGS in BOOTCFLAGS

David Gibson david at gibson.dropbear.id.au
Tue May 29 13:29:24 EST 2007


In the bootwrapper code for powerpc, we include HOSTCFLAGS into the
BOOTCFLAGS used for buildinf 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 <david at gibson.dropbear.id.au>

Index: working-2.6/arch/powerpc/boot/Makefile
===================================================================
--- working-2.6.orig/arch/powerpc/boot/Makefile	2007-05-28 16:29:34.000000000 +1000
+++ working-2.6/arch/powerpc/boot/Makefile	2007-05-28 16:29:56.000000000 +1000
@@ -11,7 +11,7 @@
 #	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,
+#	needed to build the 32 bit image.
 #	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
@@ -22,9 +22,11 @@
 
 all: $(obj)/zImage
 
-HOSTCC		:= gcc
-BOOTCFLAGS	:= $(HOSTCFLAGS) -fno-builtin -fno-unit-at-a-time -nostdinc -isystem \
-		   $(shell $(CROSS32CC) -print-file-name=include) -fPIC
+BOOTCFLAGS	:= -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
+		   -fno-strict-aliasing -O2 -msoft-float -pipe \
+		   -fomit-frame-pointer -fno-builtin -fno-unit-at-a-time \
+		   -fPIC -nostdinc \
+		   -isystem $(shell $(CROSS32CC) -print-file-name=include)
 BOOTAFLAGS	:= -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
 
 ifeq ($(call cc-option-yn, -fstack-protector),y)

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson



More information about the Linuxppc-dev mailing list