[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] x64-vmxassist-fix2.patch



Fix 64 bit build. Tested the binary built on a 64 bit platform on a 32 bit 
platform.

Signed-off-by: Arun Sharma <arun.sharma@xxxxxxxxx>

--- a/tools/firmware/vmxassist/Makefile Mon Jun 13 17:54:12 2005
+++ b/tools/firmware/vmxassist/Makefile Mon Jun 13 11:28:41 2005
@@ -18,6 +18,9 @@
 # Place - Suite 330, Boston, MA 02111-1307 USA.
 #
 
+XEN_ROOT = ../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
 # The emulator code lives in ROM space
 TEXTADDR=0x000D0000
 DEFINES=-DDEBUG -DTEXTADDR=${TEXTADDR}
@@ -32,19 +35,24 @@
 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
 
+ifeq ($(XEN_COMPILE_ARCH),x86_64)
+CFLAGS  += -m32 -march=i686
+LDFLAGS += -m elf_i386
+endif
+
 OBJECTS = head.o trap.o vm86.o setup.o util.o
 
 all: vmxloader
 
 vmxloader: roms.h vmxloader.c
-       ${CC} ${DEFINES} -c vmxloader.c
-       $(CC) -o vmxloader.tmp -nostdlib -Wl,-N -Wl,-Ttext -Wl,0x100000 
vmxloader.o
+       ${CC} ${CFLAGS} ${DEFINES} -c vmxloader.c
+       $(CC) -o vmxloader.tmp -m32 -nostdlib -Wl,-N -Wl,-Ttext -Wl,0x100000 
vmxloader.o
        objcopy --change-addresses=0xC0000000 vmxloader.tmp vmxloader
        rm -f vmxloader.tmp
 
 vmxassist.bin: vmxassist.ld ${OBJECTS}
        ${CPP} ${DEFINES} vmxassist.ld > vmxassist.tmp
-       ${LD} -o vmxassist -nostdlib --fatal-warnings -N -T vmxassist.tmp 
${OBJECTS}
+       ${LD} -o vmxassist ${LDFLAGS} -nostdlib --fatal-warnings -N -T 
vmxassist.tmp ${OBJECTS}
        nm -n vmxassist > vmxassist.sym
        ${OBJCOPY} vmxassist vmxassist.tmp
        dd if=vmxassist.tmp of=vmxassist.bin ibs=512 conv=sync
--- a/tools/firmware/vmxassist/head.S   Mon Jun 13 17:54:12 2005
+++ b/tools/firmware/vmxassist/head.S   Mon Jun 13 11:28:41 2005
@@ -106,6 +106,7 @@
  * main and setup our own environment.
  */
        .globl  _start
+       .code32
 _start:
        cli
 
--- a/tools/firmware/vmxassist/trap.S   Mon Jun 13 17:54:12 2005
+++ b/tools/firmware/vmxassist/trap.S   Mon Jun 13 11:28:41 2005
@@ -19,7 +19,6 @@
  */
 #include "machine.h"
 #include "offsets.h"
-
 
 /*
  * All processor exception/faults/interrupts end up here.
@@ -43,6 +42,7 @@
        .endm
 
        .section .rodata
+       .code32
        .align  4
        .global trap_handlers
 trap_handlers:
@@ -96,6 +96,7 @@
        TRAP_HANDLER    47, 0   /* irq 15 */
 
        .text
+       .code32
        .align  16
 common_trap:                           /* common trap handler */
        pushl   %gs

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.