From 71033f7bb8ef43dffee7d1e96d332f769842900b Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Mon, 24 Nov 2008 12:13:40 +0000 Subject: [PATCH] This patch allows me to compile openbios using the cross-pcc target on amd64 host. Signed-off-by: Laurent Vivier Acked-by: Stefan Reinauer git-svn-id: svn://coreboot.org/openbios/openbios-devel@251 f158a5a8-5612-0410-a976-696ce0be7e32 --- config/examples/cross-ppc_rules.xml | 17 +++++++++-------- kernel/bootstrap.c | 2 +- kernel/cross.h | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/config/examples/cross-ppc_rules.xml b/config/examples/cross-ppc_rules.xml index e43b556..7b93422 100644 --- a/config/examples/cross-ppc_rules.xml +++ b/config/examples/cross-ppc_rules.xml @@ -9,20 +9,21 @@ ARCH := ppc ODIR := obj-$(ARCH) HOSTCC := gcc -HOSTCFLAGS := -Os -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS) +HOSTCFLAGS := -Os -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS) -DSWAP_ENDIANNESS HOSTINCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include # # MOLPATH is needed if you want to build openbios-mol.elf # MOLPATH=$(HOME)/mol-0.9.71 -CC := powerpc-linux-gcc -AS := powerpc-linux-as -AR := powerpc-linux-ar -LD := powerpc-linux-ld -NM := powerpc-linux-nm -STRIP := powerpc-linux-strip -RANLIB := powerpc-linux-ranlib +TARGET=powerpc-linux-gnu- +CC := $(TARGET)gcc +AS := $(TARGET)as +AR := $(TARGET)ar +LD := $(TARGET)ld +NM := $(TARGET)nm +STRIP := $(TARGET)strip +RANLIB := $(TARGET)ranlib CFLAGS := -Os -Wall -W -msoft-float -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fno-builtin-bcopy -fno-builtin-log2 INCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include diff --git a/kernel/bootstrap.c b/kernel/bootstrap.c index bba2451..aa4de91 100644 --- a/kernel/bootstrap.c +++ b/kernel/bootstrap.c @@ -47,7 +47,7 @@ static FILE *srcfiles[128]; static unsigned int cursrc = 0; #ifdef NATIVE_BITWIDTH_SMALLER_THAN_HOST_BITWIDTH -ucell base_address; +unsigned long base_address; #endif /* include path handling */ diff --git a/kernel/cross.h b/kernel/cross.h index d65330e..edd5d76 100644 --- a/kernel/cross.h +++ b/kernel/cross.h @@ -113,7 +113,7 @@ #endif #ifdef NATIVE_BITWIDTH_SMALLER_THAN_HOST_BITWIDTH -extern ucell base_address; +extern unsigned long base_address; #define pointer2cell(x) ((ucell)(((unsigned long)(x))-base_address)) #define cell2pointer(x) ((u8 *)(((unsigned long)(x))+base_address)) #define FMT_CELL_x "x"