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

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



ChangeSet 1.1719, 2005/06/13 23:49:32+01:00, arun.sharma@xxxxxxxxx

        [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>



 Makefile |   14 +++++++++++---
 head.S   |    1 +
 trap.S   |    3 ++-
 3 files changed, 14 insertions(+), 4 deletions(-)


diff -Nru a/tools/firmware/vmxassist/Makefile 
b/tools/firmware/vmxassist/Makefile
--- a/tools/firmware/vmxassist/Makefile 2005-06-13 19:03:29 -04:00
+++ b/tools/firmware/vmxassist/Makefile 2005-06-13 19:03:29 -04:00
@@ -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
diff -Nru a/tools/firmware/vmxassist/head.S b/tools/firmware/vmxassist/head.S
--- a/tools/firmware/vmxassist/head.S   2005-06-13 19:03:29 -04:00
+++ b/tools/firmware/vmxassist/head.S   2005-06-13 19:03:29 -04:00
@@ -106,6 +106,7 @@
  * main and setup our own environment.
  */
        .globl  _start
+       .code32
 _start:
        cli
 
diff -Nru a/tools/firmware/vmxassist/trap.S b/tools/firmware/vmxassist/trap.S
--- a/tools/firmware/vmxassist/trap.S   2005-06-13 19:03:29 -04:00
+++ b/tools/firmware/vmxassist/trap.S   2005-06-13 19:03:29 -04:00
@@ -20,7 +20,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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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