ia64/xen-unstable

view xen/arch/x86/Makefile @ 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 eaeb26494a39
children ee8041b0ab86
line source
2 include $(BASEDIR)/Rules.mk
4 OBJS += $(patsubst %.S,%.o,$(wildcard $(TARGET_SUBARCH)/*.S))
5 OBJS += $(patsubst %.c,%.o,$(wildcard $(TARGET_SUBARCH)/*.c))
6 OBJS += $(patsubst %.c,%.o,$(wildcard acpi/*.c))
7 OBJS += $(patsubst %.c,%.o,$(wildcard genapic/*.c))
8 OBJS += $(patsubst %.c,%.o,$(wildcard cpu/*.c))
9 OBJS += $(patsubst %.c,%.o,$(wildcard cpu/mcheck/*.c))
10 OBJS += $(patsubst %.c,%.o,$(wildcard cpu/mtrr/*.c))
11 OBJS += $(patsubst %.c,%.o,$(wildcard hvm/*.c))
12 OBJS += $(patsubst %.c,%.o,$(wildcard hvm/vmx/*.c))
13 OBJS += $(patsubst %.S,%.o,$(wildcard hvm/vmx/$(TARGET_SUBARCH)/*.S))
14 OBJS += $(patsubst %.c,%.o,$(wildcard hvm/svm/*.c))
15 OBJS += $(patsubst %.S,%.o,$(wildcard hvm/svm/$(TARGET_SUBARCH)/*.S))
17 ifeq ($(TARGET_SUBARCH),x86_64)
18 OBJS := $(subst cpu/centaur.o,,$(OBJS))
19 OBJS := $(subst cpu/cyrix.o,,$(OBJS))
20 OBJS := $(subst cpu/rise.o,,$(OBJS))
21 OBJS := $(subst cpu/transmeta.o,,$(OBJS))
22 endif
24 OBJS := $(patsubst shadow%.o,,$(OBJS)) # drop all
25 ifeq ($(TARGET_SUBARCH),x86_64)
26 OBJS += shadow.o shadow_public.o shadow_guest32.o shadow_guest32pae.o # x86_64: new code
27 endif
28 ifeq ($(TARGET_SUBARCH),x86_32)
29 ifneq ($(pae),n)
30 OBJS += shadow.o shadow_public.o shadow_guest32.o # x86_32p: new code
31 else
32 OBJS += shadow32.o # x86_32: old code
33 endif
34 endif
36 OBJS := $(subst $(TARGET_SUBARCH)/asm-offsets.o,,$(OBJS))
37 OBJS := $(subst $(TARGET_SUBARCH)/xen.lds.o,,$(OBJS))
39 ifneq ($(crash_debug),y)
40 OBJS := $(patsubst gdbstub%.o,,$(OBJS))
41 endif
43 default: $(TARGET)
45 $(TARGET): $(TARGET)-syms boot/mkelf32
46 ./boot/mkelf32 $(TARGET)-syms $(TARGET) 0x100000 \
47 `$(NM) $(TARGET)-syms | sort | tail -n 1 | sed -e 's/^\([^ ]*\).*/0x\1/'`
49 $(CURDIR)/arch.o: $(OBJS)
50 $(LD) $(LDFLAGS) -r -o $@ $(OBJS)
52 $(TARGET)-syms: boot/$(TARGET_SUBARCH).o $(ALL_OBJS) xen.lds
53 $(LD) $(LDFLAGS) -T xen.lds -N \
54 boot/$(TARGET_SUBARCH).o $(ALL_OBJS) -o $@
55 $(NM) -n $@ | $(BASEDIR)/tools/symbols >$(BASEDIR)/xen-syms.S
56 $(MAKE) $(BASEDIR)/xen-syms.o
57 $(LD) $(LDFLAGS) -T xen.lds -N \
58 boot/$(TARGET_SUBARCH).o $(ALL_OBJS) $(BASEDIR)/xen-syms.o -o $@
59 $(NM) -n $@ | $(BASEDIR)/tools/symbols >$(BASEDIR)/xen-syms.S
60 $(MAKE) $(BASEDIR)/xen-syms.o
61 $(LD) $(LDFLAGS) -T xen.lds -N \
62 boot/$(TARGET_SUBARCH).o $(ALL_OBJS) $(BASEDIR)/xen-syms.o -o $@
63 rm -f $(BASEDIR)/xen-syms.S $(BASEDIR)/xen-syms.o
65 asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c $(HDRS)
66 $(CC) $(CFLAGS) -S -o $@ $<
68 xen.lds: $(TARGET_SUBARCH)/xen.lds.S $(HDRS)
69 $(CC) $(CFLAGS) -P -E -Ui386 -D__ASSEMBLY__ -o $@ $<
71 boot/mkelf32: boot/mkelf32.c
72 $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
74 shadow_guest32.o: shadow.c
76 clean:
77 rm -f *.o *.s *~ core boot/*.o boot/*~ boot/core boot/mkelf32
78 rm -f x86_32/*.o x86_32/*~ x86_32/core
79 rm -f x86_64/*.o x86_64/*~ x86_64/core
80 rm -f mtrr/*.o mtrr/*~ mtrr/core
81 rm -f acpi/*.o acpi/*~ acpi/core
82 rm -f genapic/*.o genapic/*~ genapic/core
83 rm -f cpu/*.o cpu/*~ cpu/core
84 rm -f hvm/*.o hvm/*~ hvm/core
85 rm -f hvm/vmx/*.o hvm/vmx/*~ hvm/vmx/core
86 rm -f hvm/vmx/x86_32/*.o hvm/vmx/x86_32/*~ hvm/vmx/x86_32/core
87 rm -f hvm/vmx/x86_64/*.o hvm/vmx/x86_64/*~ hvm/vmx/x86_64/core
88 rm -f hvm/svm/*.o hvm/svm/*~ hvm/svm/core
89 rm -f hvm/svm/x86_32/*.o hvm/svm/x86_32/*~ hvm/svm/x86_32/core
90 rm -f hvm/svm/x86_64/*.o hvm/svm/x86_64/*~ hvm/svm/x86_64/core
91 rm -f xen.lds
93 .PHONY: default clean