Skip to contentSkip to conversation

Fix 32bit xen-tools build.

PATCH In review [email protected] 3 participants 5 messages Oct 20, 2006 – Oct 23, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix 32bit xen-tools build.

This fixes building 32bit xen-tools on a amd64 machine, i.e. "XEN_TARGET_ARCH=x86_32 make".

For ioemu I've taken the lazy path and just disabled them for cross-builds, I'll leave that to fix to someone who knows the qemu makefiles better than I do ;)

---
 config/x86_32.mk |    6 ++++--
 tools/Makefile   |    2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)
config/x86_32.mk +4 -2
Index: build-32-unstable-11822/config/x86_32.mk
===================================================================
@@ -6,8 +6,10 @@ CONFIG_MIGRATE := y
 CONFIG_XCUTILS := y
 CONFIG_IOEMU := y
 
-CFLAGS += -m32 -march=i686
-LIBDIR := lib
+CFLAGS  += -m32 -march=i686
+LDFLAGS += -m32
+ASFLAGS += -m32
+LIBDIR  := lib
 
 # Use only if calling $(LD) directly.
 ifeq ($(XEN_OS),OpenBSD)
tools/Makefile +1 -1
Index: build-32-unstable-11822/tools/Makefile
===================================================================
@@ -60,7 +60,7 @@ check_clean:
 	$(MAKE) -C check clean
 
 .PHONY: ioemu ioemuinstall ioemuclean
-ifeq ($(CONFIG_IOEMU),y)
+ifeq ($(XEN_COMPILE_ARCH)$(CONFIG_IOEMU),$(XEN_TARGET_ARCH)y)
 export IOEMU_DIR ?= ioemu
 ioemu ioemuinstall:
 	[ -f $(IOEMU_DIR)/config-host.mak ] || \

--

#1 lore raw
Quoted 5 lines · On Fri, Oct 20, 2006 at 10:36:08AM +0200, [email protected] wrote:

Index: build-32-unstable-11822/config/x86_32.mk
===================================================================

config/x86_32.mk CONFIG_MIGRATE := y · line 12

Quoted 9 lines
config/x86_32.mk +4 -2
@@ -6,8 +6,10 @@ CONFIG_MIGRATE := y
 CONFIG_XCUTILS := y
 CONFIG_IOEMU := y
 
-CFLAGS += -m32 -march=i686
-LIBDIR := lib
+CFLAGS  += -m32 -march=i686
+LDFLAGS += -m32
+ASFLAGS += -m32
+LIBDIR  := lib

Where is left that needs LDFLAGS/ASFLAGS to have the -m flags? It's wrong anyway, there should be nowhere that's not using $CFLAGS; see the previous discussion. We've had to disable a couple of directories for now, so probably it's in one of those?

regards
john

#2 lore raw
Quoted 11 lines · John Levon

config/x86_32.mk CONFIG_MIGRATE := y · line 12

Quoted 6 lines
config/x86_32.mk +4 -2
-CFLAGS += -m32 -march=i686
-LIBDIR := lib
+CFLAGS  += -m32 -march=i686
+LDFLAGS += -m32
+ASFLAGS += -m32
+LIBDIR  := lib

Where is left that needs LDFLAGS/ASFLAGS to have the -m flags? It's wrong anyway, there should be nowhere that's not using $CFLAGS; see the previous discussion. We've had to disable a couple of directories for now, so probably it's in one of those?

Bit more context: anywhere that *is* using $(LD) directly should add $(LDFLAGS_DIRECT) to the command line. This adds -mi386 or -mx86_64. The linker does not understand -m32/-m64. But anywhere not doing tricky links (e.g., with a GNU-specific script) should call the linker via the GCC driver.

-- Keir

#3 lore raw
Quoted 7 lines · Keir Fraser
Quoted 4 lines · John Levon

Where is left that needs LDFLAGS/ASFLAGS to have the -m flags? It's wrong anyway, there should be nowhere that's not using $CFLAGS; see the previous discussion. We've had to disable a couple of directories for now, so probably it's in one of those?

Quoted 5 lines

Bit more context: anywhere that *is* using $(LD) directly should add $(LDFLAGS_DIRECT) to the command line. This adds -mi386 or -mx86_64. The linker does not understand -m32/-m64. But anywhere not doing tricky links (e.g., with a GNU-specific script) should call the linker via the GCC driver.

Rechecked, seems to be fixed now, except for qemu-dm which still doesn't build when compiling 32bit tools on a 64bit machine ...

cheers,
Gerd

Signature · 2 lines
Gerd Hoffmann <[email protected]>
http://www.suse.de/~kraxel/julika-dora.jpeg
#4 lore raw
Quoted 8 lines · Gerd Hoffmann
Quoted 5 lines

Bit more context: anywhere that *is* using $(LD) directly should add $(LDFLAGS_DIRECT) to the command line. This adds -mi386 or -mx86_64. The linker does not understand -m32/-m64. But anywhere not doing tricky links (e.g., with a GNU-specific script) should call the linker via the GCC driver.

Rechecked, seems to be fixed now, except for qemu-dm which still doesn't build when compiling 32bit tools on a 64bit machine ...

It has its own configuration system which may need patching. It basically doesn't use the Config.mk/Rules.mk definitions that everyone else does.

-- Keir