xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andres Lagar-Cavilla <andres@lagarcavilla.org>
To: xen-devel@lists.xensource.com
Cc: andres@gridcentric.ca, adin@gridcentric.ca
Subject: [PATCH 2 of 2] Fixes for cross-compiling 32-bit tools on 64-bit host
Date: Mon, 14 Nov 2011 16:53:53 -0500	[thread overview]
Message-ID: <19a5a2cddad32321f53b.1321307633@xdev.gridcentric.ca> (raw)
In-Reply-To: <patchbomb.1321307631@xdev.gridcentric.ca>

 tools/Makefile                   |  8 +++++++-
 tools/blktap/drivers/Makefile    |  1 +
 tools/blktap2/vhd/lib/Makefile   |  1 +
 tools/debugger/gdbsx/Makefile    |  2 +-
 tools/libaio/src/Makefile        |  2 +-
 tools/libfsimage/common/Makefile |  4 ++--
 6 files changed, 13 insertions(+), 5 deletions(-)


With this patch a full 32 bit build of the tool set is possible
on a 64 bit host. No errors or warnigns.

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>

diff -r bf47f7aaf669 -r 19a5a2cddad3 tools/Makefile
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -74,7 +74,13 @@ distclean: subdirs-distclean
 	rm -rf ioemu-dir ioemu-remote
 
 ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
-IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \
+ifeq ($(XEN_TARGET_ARCH),x86_32)
+# The qemu build uses i386 instead of x86_32.
+IOEMU_CONFIGURE_CPU ?= --cpu=i386
+else
+IOEMU_CONFIGURE_CPU ?= --cpu=$(XEN_TARGET_ARCH)
+endif
+IOEMU_CONFIGURE_CROSS ?= $(IOEMU_CONFIGURE_CPU) \
 			 --cross-prefix=$(CROSS_COMPILE) \
 			 --interp-prefix=$(CROSS_SYS_ROOT)
 endif
diff -r bf47f7aaf669 -r 19a5a2cddad3 tools/blktap/drivers/Makefile
--- a/tools/blktap/drivers/Makefile
+++ b/tools/blktap/drivers/Makefile
@@ -14,6 +14,7 @@ CFLAGS   += $(CFLAGS_libxenstore)
 CFLAGS   += -I $(LIBAIO_DIR)
 CFLAGS   += -I $(MEMSHR_DIR)
 CFLAGS   += -D_GNU_SOURCE
+CFLAGS   += -D_FILE_OFFSET_BITS=64
 
 ifeq ($(shell . ./check_gcrypt $(CC)),yes)
 CFLAGS += -DUSE_GCRYPT
diff -r bf47f7aaf669 -r 19a5a2cddad3 tools/blktap2/vhd/lib/Makefile
--- a/tools/blktap2/vhd/lib/Makefile
+++ b/tools/blktap2/vhd/lib/Makefile
@@ -18,6 +18,7 @@ CFLAGS          += -I../../include
 CFLAGS          += -D_GNU_SOURCE
 CFLAGS          += -fPIC
 CFLAGS          += -g
+CFLAGS          += -D_FILE_OFFSET_BITS=64
 
 ifeq ($(CONFIG_Linux),y)
 LIBS            := -luuid
diff -r bf47f7aaf669 -r 19a5a2cddad3 tools/debugger/gdbsx/Makefile
--- a/tools/debugger/gdbsx/Makefile
+++ b/tools/debugger/gdbsx/Makefile
@@ -18,7 +18,7 @@ install: all
 	$(INSTALL_PROG) gdbsx $(DESTDIR)$(SBINDIR)/gdbsx
 
 gdbsx: gx/gx_all.a xg/xg_all.a 
-	$(CC) -o $@ $^
+	$(CC) $(LDFLAGS) -o $@ $^
 
 xg/xg_all.a:
 	$(MAKE) -C xg
diff -r bf47f7aaf669 -r 19a5a2cddad3 tools/libaio/src/Makefile
--- a/tools/libaio/src/Makefile
+++ b/tools/libaio/src/Makefile
@@ -6,7 +6,7 @@ includedir=$(prefix)/include
 libdir=$(prefix)/lib
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/)
-CFLAGS = -nostdlib -nostartfiles -Wall -I. -g -fomit-frame-pointer -O2 -fPIC
+CFLAGS := $(CFLAGS) -nostdlib -nostartfiles -Wall -I. -g -fomit-frame-pointer -O2 -fPIC
 SO_CFLAGS=-shared $(CFLAGS)
 L_CFLAGS=$(CFLAGS)
 LINK_FLAGS=
diff -r bf47f7aaf669 -r 19a5a2cddad3 tools/libfsimage/common/Makefile
--- a/tools/libfsimage/common/Makefile
+++ b/tools/libfsimage/common/Makefile
@@ -4,8 +4,8 @@ include $(XEN_ROOT)/tools/Rules.mk
 MAJOR = 1.0
 MINOR = 0
 
-LDFLAGS-$(CONFIG_SunOS) = -Wl,-M -Wl,mapfile-SunOS
-LDFLAGS-$(CONFIG_Linux) = -Wl,mapfile-GNU
+LDFLAGS-$(CONFIG_SunOS) := $(LDFLAGS) -Wl,-M -Wl,mapfile-SunOS
+LDFLAGS-$(CONFIG_Linux) := $(LDFLAGS) -Wl,mapfile-GNU
 LDFLAGS = $(LDFLAGS-y)
 
 LIB_SRCS-y = fsimage.c fsimage_plugin.c fsimage_grub.c

      parent reply	other threads:[~2011-11-14 21:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-14 21:53 [PATCH 0 of 2] Fixes for cross-compiling 32 bit tools on 64 bit host Andres Lagar-Cavilla
2011-11-14 21:53 ` [PATCH 1 of 2] Add linker flags to makefile rules to enable cross compiling Andres Lagar-Cavilla
2011-11-15  8:55   ` Ian Campbell
2011-11-14 21:53 ` Andres Lagar-Cavilla [this message]

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=19a5a2cddad32321f53b.1321307633@xdev.gridcentric.ca \
    --to=andres@lagarcavilla.org \
    --cc=adin@gridcentric.ca \
    --cc=andres@gridcentric.ca \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).