All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arun Sharma <arun.sharma@intel.com>
To: Ian Pratt <Ian.Pratt@cl.cam.ac.uk>,
	Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com
Subject: [PATCH] x64-vmxassist-fix2.patch
Date: Mon, 13 Jun 2005 12:12:02 -0700	[thread overview]
Message-ID: <20050613191202.GA31267@intel.com> (raw)

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@intel.com>

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

                 reply	other threads:[~2005-06-13 19:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050613191202.GA31267@intel.com \
    --to=arun.sharma@intel.com \
    --cc=Ian.Pratt@cl.cam.ac.uk \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.