# This must match PAGE_OFFSET in include/asm-ppc/page.h.
KERNELLOAD := $(CONFIG_KERNEL_START)
-HAS_BIARCH := $(shell if $(CC) -m32 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi;)
+HAS_BIARCH := $(call cc-option-yn, -m32)
ifeq ($(HAS_BIARCH),y)
AS := $(AS) -a32
LD := $(LD) -m elf32ppc
CPPFLAGS += -Iarch/$(ARCH)
AFLAGS += -Iarch/$(ARCH)
CFLAGS += -Iarch/$(ARCH) -msoft-float -pipe \
- -ffixed-r2 -Wno-uninitialized -mmultiple
+ -ffixed-r2 -mmultiple
CPP = $(CC) -E $(CFLAGS)
-CHECK := $(CHECK) -D__powerpc__=1
+CHECKFLAGS += -D__powerpc__
ifndef CONFIG_E500
CFLAGS += -mstring
all: zImage
-AFLAGS_vmlinux.lds.o := -Upowerpc
+CPPFLAGS_vmlinux.lds := -Upowerpc
# All the instructions talk about "make bzImage".
bzImage: zImage
include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
$(call filechk,gen-asm-offsets)
-ifdef CONFIG_6xx
-# Ensure this is binutils 2.12.1 (or 2.12.90.0.7) or later
-NEW_AS := $(shell echo dssall | $(AS) -many -o /dev/null >/dev/null 2>&1 ; echo $$?)
-GOODVER := 2.12.1
-else
-NEW_AS := 0
-endif
+# Use the file '.tmp_gas_check' for binutils tests, as gas won't output
+# to stdout and these checks are run even on install targets.
+TOUT := .tmp_gas_check
+# Ensure this is binutils 2.12.1 (or 2.12.90.0.7) or later for altivec
+# instructions.
+AS_ALTIVEC := $(shell echo dssall | $(AS) -many -o $(TOUT) >/dev/null 2>&1 ; echo $$?)
# gcc-3.4 and binutils-2.14 are a fatal combination.
-GCC_VERSION := $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))
-BAD_GCC_AS := $(shell echo mftb 5 | $(AS) -mppc -many -o /dev/null >/dev/null 2>&1 && echo 0 || echo 1)
+GCC_VERSION := $(call cc-version)
+BAD_GCC_AS := $(shell echo mftb 5 | $(AS) -mppc -many -o $(TOUT) >/dev/null 2>&1 && echo 0 || echo 1)
checkbin:
ifeq ($(GCC_VERSION)$(BAD_GCC_AS),03041)
@echo '*** Please upgrade your binutils or downgrade your gcc'
@false
endif
-ifneq ($(NEW_AS),0)
+ifneq ($(AS_ALTIVEC),0)
+ echo $(AS_ALTIVEC)
@echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '
@echo 'correctly with old versions of binutils.'
- @echo '*** Please upgrade your binutils to ${GOODVER} or newer'
+ @echo '*** Please upgrade your binutils to 2.12.1 or newer'
@false
endif
@true
CLEAN_FILES += include/asm-$(ARCH)/offsets.h \
- arch/$(ARCH)/kernel/asm-offsets.s
+ arch/$(ARCH)/kernel/asm-offsets.s \
+ $(TOUT)
+