[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Fix firmware build for cross-compilation.
# HG changeset patch # User kaf24@xxxxxxxxxxxxxxxxxxxx # Node ID 68e754d7e1cb56ad6c732b1f896063f22850749c # Parent def91f2dbc890da85a6e159d71a30ff6157a7a9f Fix firmware build for cross-compilation. Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> diff -r def91f2dbc89 -r 68e754d7e1cb tools/firmware/acpi/acpi_gen.c --- a/tools/firmware/acpi/acpi_gen.c Wed Oct 12 10:47:16 2005 +++ b/tools/firmware/acpi/acpi_gen.c Wed Oct 12 12:03:10 2005 @@ -16,44 +16,38 @@ * */ #include "acpi2_0.h" -#include "stdio.h" +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> -/* - * Generate acpi table - * write acpi table to binary: acpitable.bin - * - */ - -#define USAGE "Usage: acpi_gen filename \n" \ - " generage acpitable and write to the binary \n" \ - " filename - the binary name\n" +#define USAGE "Usage: acpi_gen filename \n" \ + " generage acpitable and write to the binary \n" \ + " filename - the binary name\n" +int main(int argc, char **argv) +{ + char *filename; + char buf[ACPI_TABLE_SIZE] = { 0 }; + FILE *f; -int main(int argc, char** argv){ - char* filename; - char buf[ACPI_TABLE_SIZE]; - FILE* f=NULL; - int i; + if (argc < 2) { + fprintf(stderr,"%s",USAGE); + exit(1); + } - for (i=0; i<ACPI_TABLE_SIZE; i++){ - buf[i]=0; - } + filename = argv[1]; + + if ((f = fopen(filename, "w+")) == NULL) { + fprintf(stderr,"Can not open %s", filename); + exit(1); + } - if (argc<2){ - fprintf(stderr,"%s",USAGE); - exit(1); - } + AcpiBuildTable((uint8_t *)buf); - filename = argv[1]; - - if(!(f=fopen(filename, "w+"))){ - fprintf(stderr,"Can not open %s",filename); - exit(1); - } - AcpiBuildTable(buf); - if (fwrite(buf, ACPI_TABLE_SIZE, 1, f)<1){ - fprintf(stderr,"Can not write to %s\n",filename); - exit(1); - } - return 0; + if (fwrite(buf, ACPI_TABLE_SIZE, 1, f) < 1) { + fprintf(stderr,"Can not write to %s\n", filename); + exit(1); + } + + return 0; } diff -r def91f2dbc89 -r 68e754d7e1cb tools/firmware/vmxassist/Makefile --- a/tools/firmware/vmxassist/Makefile Wed Oct 12 10:47:16 2005 +++ b/tools/firmware/vmxassist/Makefile Wed Oct 12 12:03:10 2005 @@ -24,14 +24,14 @@ # The emulator code lives in ROM space TEXTADDR=0x000D0000 -DEFINES=-DDEBUG -DTEXTADDR=${TEXTADDR} +DEFINES=-DDEBUG -DTEXTADDR=$(TEXTADDR) XENINC=-I$(XEN_ROOT)/tools/libxc LD = ld CC = gcc CPP = cpp -P OBJCOPY = objcopy -p -O binary -R .note -R .comment -R .bss -S --gap-fill=0 -CFLAGS = ${DEFINES} -I. $(XENINC) -Wall -fno-builtin -O2 -msoft-float +CFLAGS = $(DEFINES) -I. $(XENINC) -Wall -fno-builtin -O2 -msoft-float CFLAGS += -m32 -march=i686 LDFLAGS = -m elf_i386 @@ -40,33 +40,33 @@ all: vmxloader vmxloader: roms.h vmxloader.c acpi.h acpi_madt.c - ${CC} ${CFLAGS} ${DEFINES} -c vmxloader.c -c acpi_madt.c + $(CC) $(CFLAGS) $(DEFINES) -c vmxloader.c -c acpi_madt.c $(CC) -o vmxloader.tmp -m32 -nostdlib -Wl,-N -Wl,-Ttext -Wl,0x100000 vmxloader.o acpi_madt.o objcopy vmxloader.tmp vmxloader rm -f vmxloader.tmp -vmxassist.bin: vmxassist.ld ${OBJECTS} - ${CPP} ${DEFINES} vmxassist.ld > vmxassist.tmp - ${LD} -o vmxassist ${LDFLAGS} -nostdlib --fatal-warnings -N -T vmxassist.tmp ${OBJECTS} +vmxassist.bin: vmxassist.ld $(OBJECTS) + $(CPP) $(DEFINES) vmxassist.ld > vmxassist.tmp + $(LD) -o vmxassist $(LDFLAGS) -nostdlib --fatal-warnings -N -T vmxassist.tmp $(OBJECTS) nm -n vmxassist > vmxassist.sym - ${OBJCOPY} vmxassist vmxassist.tmp + $(OBJCOPY) vmxassist vmxassist.tmp dd if=vmxassist.tmp of=vmxassist.bin ibs=512 conv=sync rm -f vmxassist.tmp head.o: machine.h head.S - ${CC} ${CFLAGS} -D__ASSEMBLY__ ${DEFINES} -c head.S + $(CC) $(CFLAGS) -D__ASSEMBLY__ $(DEFINES) -c head.S trap.o: machine.h offsets.h trap.S - ${CC} ${CFLAGS} -D__ASSEMBLY__ ${DEFINES} -c trap.S + $(CC) $(CFLAGS) -D__ASSEMBLY__ $(DEFINES) -c trap.S vm86.o: machine.h vm86.c - ${CC} ${CFLAGS} -c vm86.c + $(CC) $(CFLAGS) -c vm86.c setup.o: machine.h setup.c - ${CC} ${CFLAGS} -c setup.c + $(CC) $(CFLAGS) -c setup.c util.o: machine.h util.c - ${CC} ${CFLAGS} -c util.c + $(CC) $(CFLAGS) -c util.c roms.h: ../rombios/BIOS-bochs-latest ../vgabios/VGABIOS-lgpl-latest.bin ../vgabios/VGABIOS-lgpl-latest.cirrus.bin vmxassist.bin ./mkhex rombios ../rombios/BIOS-bochs-latest > roms.h @@ -81,10 +81,10 @@ ./gen > offsets.h gen: gen.c - ${CC} ${CFLAGS} -o gen gen.c + $(HOSTCC) $(HOSTCFLAGS) -I. $(XENINC) -o gen gen.c clean: rm -f vmxassist vmxassist.tmp vmxassist.bin vmxassist.run vmxassist.sym head.s roms.h acpi.h - rm -f vmxloader vmxloader.tmp vmxloader.o ${OBJECTS} + rm -f vmxloader vmxloader.tmp vmxloader.o $(OBJECTS) rm -f gen gen.o offsets.h _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |