@@ -23,7 +23,7 @@ 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)
-ifdef CONFIG_PPC64
+ifdef CONFIG_PPC64_BOOT_WRAPPER
BOOTCFLAGS += -m64
endif
ifdef CONFIG_CPU_BIG_ENDIAN
@@ -140,7 +140,7 @@ fi
elfformat="`${CROSS}objdump -p "$kernel" | grep 'file format' | awk '{print $4}'`"
case "$elfformat" in
elf64-powerpcle) format=elf64lppc ;;
- elf64-powerpc) format=elf64ppc ;;
+ elf64-powerpc) format=elf32ppc ;;
elf32-powerpc) format=elf32ppc ;;
esac
@@ -1,6 +1,6 @@
#include <asm-generic/vmlinux.lds.h>
-#ifdef CONFIG_PPC64
+#ifdef CONFIG_PPC64_BOOT_WRAPPER
OUTPUT_ARCH(powerpc:common64)
#else
OUTPUT_ARCH(powerpc:common)
@@ -22,7 +22,7 @@ SECTIONS
*(.rodata*)
*(.data*)
*(.sdata*)
-#ifdef CONFIG_PPC32
+#ifndef CONFIG_PPC64_BOOT_WRAPPER
*(.got2)
#endif
}
@@ -37,7 +37,7 @@ SECTIONS
.interp : { *(.interp) }
.rela.dyn :
{
-#ifdef CONFIG_PPC64
+#ifdef CONFIG_PPC64_BOOT_WRAPPER
__rela_dyn_start = .;
#endif
*(.rela*)
@@ -67,7 +67,7 @@ SECTIONS
_initrd_end = .;
}
-#ifdef CONFIG_PPC64
+#ifdef CONFIG_PPC64_BOOT_WRAPPER
.got :
{
__toc_start = .;
@@ -420,6 +420,7 @@ config CPU_BIG_ENDIAN
config CPU_LITTLE_ENDIAN
bool "Build little endian kernel"
+ select PPC64_BOOT_WRAPPER
help
Build a little endian kernel.
@@ -428,3 +429,7 @@ config CPU_LITTLE_ENDIAN
little endian powerpc.
endchoice
+
+config PPC64_BOOT_WRAPPER
+ def_bool n
+ depends on CPU_LITTLE_ENDIAN
The previous patch broke compatibility for 64bit big endian kernels. This patch adds a config option to compile the boot wrapper in 64bit only when CPU_LITTLE_ENDIAN is selected. It restores 32bit compilation and linking for the big endian kernel. Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> --- arch/powerpc/boot/Makefile | 2 +- arch/powerpc/boot/wrapper | 2 +- arch/powerpc/boot/zImage.lds.S | 8 ++++---- arch/powerpc/platforms/Kconfig.cputype | 5 +++++ 4 files changed, 11 insertions(+), 6 deletions(-)