ia64/xen-unstable

changeset 9026:a5830f7fd7e0

Cross-compilation fixes (x86/64 on i386).

Use strtoull to parse the final_exec_addr value from the command
line. Whe cross compiling on i386 for x86-64 unsigned long is 32 bit,
which leads to final_exec_addr being truncated to 32 bits by strtoul,
which leads to grub refusing to load the resulting image. Please
apply.

Use the target nm(1) when cross compiling to pick the _end address
from the Xen binary.

Signed-Off-By: Muli Ben-Yehuda <mulix@mulix.org>
author kaf24@firebug.cl.cam.ac.uk
date Sun Feb 26 10:42:07 2006 +0100 (2006-02-26)
parents 0d7c3c47ad20
children b567eb77399f
files xen/arch/x86/Makefile xen/arch/x86/boot/mkelf32.c
line diff
     1.1 --- a/xen/arch/x86/Makefile	Sat Feb 25 22:29:18 2006 +0100
     1.2 +++ b/xen/arch/x86/Makefile	Sun Feb 26 10:42:07 2006 +0100
     1.3 @@ -44,7 +44,7 @@ default: $(TARGET)
     1.4  
     1.5  $(TARGET): $(TARGET)-syms boot/mkelf32
     1.6  	./boot/mkelf32 $(TARGET)-syms $(TARGET) 0x100000 \
     1.7 -	`nm $(TARGET)-syms | sort | tail -n 1 | sed -e 's/^\([^ ]*\).*/0x\1/'`
     1.8 +	`$(NM) $(TARGET)-syms | sort | tail -n 1 | sed -e 's/^\([^ ]*\).*/0x\1/'`
     1.9  
    1.10  $(CURDIR)/arch.o: $(OBJS)
    1.11  	$(LD) $(LDFLAGS) -r -o $@ $(OBJS)
     2.1 --- a/xen/arch/x86/boot/mkelf32.c	Sat Feb 25 22:29:18 2006 +0100
     2.2 +++ b/xen/arch/x86/boot/mkelf32.c	Sun Feb 26 10:42:07 2006 +0100
     2.3 @@ -244,7 +244,7 @@ int main(int argc, char **argv)
     2.4  
     2.5      inimage  = argv[1];
     2.6      outimage = argv[2];
     2.7 -    loadbase = strtoul(argv[3], NULL, 16);
     2.8 +    loadbase = strtoull(argv[3], NULL, 16);
     2.9      final_exec_addr = strtoul(argv[4], NULL, 16);
    2.10  
    2.11      infd = open(inimage, O_RDONLY);