Fix Solaris ioemu compile
PATCH 1/1 Fix Solaris ioemu compile
# HG changeset patch
# User [email protected]
# Date 1193952512 25200
# Node ID 7583b0a9a0f3f2face8647bb917453de3fb79a57 # Parent 77ec1c985fad24c5f63215dcea7dbe0a56f49e83 Fix Solaris ioemu compile
Fixes for Solaris compilation.
tools/Makefile +11 -4
@@ -1,4 +1,3 @@ XEN_ROOT = ../ -XEN_ROOT = ../ include $(XEN_ROOT)/tools/Rules.mk SUBDIRS-y :=
@@ -67,10 +66,18 @@ check_clean: .PHONY: ioemu ioemuinstall ioemuclean ifeq ($(CONFIG_IOEMU),y) export IOEMU_DIR ?= ioemu +ifeq ($(XEN_TARGET_ARCH),x86_64) +export IOEMU_TARGET ?= x86_64-dm +else +export IOEMU_TARGET ?= i386-dm +endif + ioemu ioemuinstall: - [ -f $(IOEMU_DIR)/config-host.mak ] || \ - (cd $(IOEMU_DIR) && sh configure --prefix=/usr) - $(MAKE) -C $(IOEMU_DIR) $(patsubst ioemu%,%,$@) + if [ -f $(IOEMU_DIR)/config-host.mak ] || \ + (cd $(IOEMU_DIR) && sh configure --target-list=$(IOEMU_TARGET) \ + --prefix=/usr --install=$(INSTALL)); then \ + $(MAKE) -C $(IOEMU_DIR) $(patsubst ioemu%,%,$@); \ + fi; ioemuclean: $(MAKE) -C $(IOEMU_DIR) distclean else
tools/firmware/hvmloader/Makefile +3 -4
@@ -31,9 +31,8 @@ CFLAGS += $(call cc-option,$(CC),-fno-s CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,) CFLAGS += $(call cc-option,$(CC),-fno-stack-protector-all,) -OBJCOPY = objcopy -CFLAGS += -fno-builtin -O2 -msoft-float -LDFLAGS = -nostdlib -Wl,-N -Wl,-Ttext -Wl,$(LOADADDR) +CFLAGS += -m32 -fno-builtin -O2 -msoft-float +LDFLAGS_DIRECT = -nostdlib -N -Ttext $(LOADADDR) SRCS = hvmloader.c mp_tables.c util.c smbios.c 32bitbios_support.c OBJS = $(patsubst %.c,%.o,$(SRCS))
@@ -43,7 +42,7 @@ all: hvmloader hvmloader: roms.h acpi/acpi.a $(SRCS) $(CC) $(CFLAGS) -c $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) -o hvmloader.tmp $(OBJS) acpi/acpi.a + $(LD) $(LDFLAGS_DIRECT) -o hvmloader.tmp $(OBJS) acpi/acpi.a $(OBJCOPY) hvmloader.tmp hvmloader rm -f hvmloader.tmp
tools/firmware/hvmloader/acpi/acpi2_0.h +1 -13
@@ -18,19 +18,7 @@#ifndef _ACPI_2_0_H_#define _ACPI_2_0_H_ -typedef unsigned char uint8_t ; -typedef signed char int8_t ; -typedef unsigned short uint16_t ; -typedef signed short int16_t ; -typedef unsigned int uint32_t ; -typedef signed int int32_t ; -#ifdef __i386__ -typedef unsigned long long uint64_t ; -typedef signed long long int64_t ; -#else -typedef unsigned long uint64_t ; -typedef signed long int64_t ; -#endif +#include <inttypes.h> #include <xen/xen.h>
tools/firmware/vmxassist/Makefile +2 -2
@@ -37,7 +37,7 @@ CFLAGS += $(call cc-option,$(CC),-fno-s CFLAGS += $(call cc-option,$(CC),-fno-stack-protector-all,) CPP = cpp -P -OBJCOPY = objcopy -p -O binary -R .note -R .comment -R .bss -S --gap-fill=0 +DOOBJCOPY = $(OBJCOPY) -p -O binary -R .note -R .comment -R .bss -S --gap-fill=0 CFLAGS += $(DEFINES) -I. $(XENINC) -fno-builtin -O2 -msoft-float OBJECTS = head.o trap.o vm86.o setup.o util.o
@@ -49,7 +49,7 @@ vmxassist.bin: vmxassist.ld $(OBJECTS) $(CPP) $(DEFINES) vmxassist.ld > vmxassist.tmp $(LD) -o vmxassist $(LDFLAGS_DIRECT) -nostdlib --fatal-warnings -N -T vmxassist.tmp $(OBJECTS) nm -n vmxassist > vmxassist.sym - $(OBJCOPY) vmxassist vmxassist.tmp + $(DOOBJCOPY) vmxassist vmxassist.tmp dd if=vmxassist.tmp of=vmxassist.bin ibs=512 conv=sync rm -f vmxassist.tmp
tools/ioemu/hw/input.h new file +578 -0
578 lines not on this page · raw message
tools/ioemu/hw/xenfb.c +1 -1
@@ -16,9 +16,9 @@#include <string.h> #include <time.h> #include <xs.h> -#include <linux/input.h> #include "xenfb.h" +#include "input.h" // FIXME defend against malicious frontend?
Quoted 3 lines · On 1/11/07 21:28, "[email protected]" <[email protected]> wrote:
Fix Solaris ioemu compile
Fixes for Solaris compilation.
That's quite a lot of patch. Have these components never built on Solaris before?
-- Keir
Quoted 3 lines · On 1/11/07 21:28, "[email protected]" <[email protected]> wrote:
Fix Solaris ioemu compile
Fixes for Solaris compilation.
Mostly applied, with a few exceptions:
* Didn't add -m32 to CFLAGS in hvmloader/Makefile. XEN_TARGET_ARCH=x86_32
should ensure that CFLAGS gets set up correctly anyway, and also there was no equivalent addition of -m32 to CFLAGS in vmxassist/Makefile, so I guess it's probably not needed at all.
* I couldn't fathom any of the changes to tools/Makefile, so I didn't apply
any of them. Removing the XEN_ROOT assignment made no sense to me, and I don't understand the ioemu configuration changes. If they're in response to Daniel Berrange's ioemu changes, then maybe he can comment.
-- Keir
Quoted 12 lines · On Friday 02 November 2007 11:15:45 Keir Fraser wrote:
Quoted 3 lines · On 1/11/07 21:28, "[email protected]" <[email protected]> wrote:
Fix Solaris ioemu compile
Fixes for Solaris compilation.
Mostly applied, with a few exceptions:
* Didn't add -m32 to CFLAGS in hvmloader/Makefile. XEN_TARGET_ARCH=x86_32
should ensure that CFLAGS gets set up correctly anyway, and also there was no equivalent addition of -m32 to CFLAGS in vmxassist/Makefile, so I guess it's probably not needed at all.
Quoted 4 lines
* I couldn't fathom any of the changes to
tools/Makefile, so I didn't
apply any of them. Removing theXEN_ROOTassignment made no sense to me, and I don't understand the ioemu configuration changes. If they're in response to Daniel Berrange's ioemu changes, then maybe he can comment.
If you are compiling on x86-64, then you need to (cross-)build hvmloader to a 32bit binary via the -m32 option. In that case, XEN_TARGET_ARCH does not match "x86_32".
Christoph
Signature · 12 lines
AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Geschäftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplementär: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Geschäftsführer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy
Quoted 3 lines · Christoph Egger
If you are compiling on x86-64, then you need to (cross-)build hvmloader to a 32bit binary via the -m32 option. In that case,
XEN_TARGET_ARCHdoes not match "x86_32".
XEN_TARGET_ARCH is overridden in the vmxassist and hvmloader Makefiles.
-- Keir
Quoted 6 lines · On Friday 02 November 2007 11:43:07 Keir Fraser wrote:
Quoted 3 lines · Christoph Egger
If you are compiling on x86-64, then you need to (cross-)build hvmloader to a 32bit binary via the -m32 option. In that case,
XEN_TARGET_ARCHdoes not match "x86_32".
XEN_TARGET_ARCHis overridden in the vmxassist and hvmloader Makefiles.
Ah, I see. Thanks for clarification.
Signature · 12 lines
AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Geschäftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplementär: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Geschäftsführer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy
Quoted 6 lines · Keir Fraser
Quoted 3 lines
Fix Solaris ioemu compile
Fixes for Solaris compilation.
That's quite a lot of patch. Have these components never built on Solaris before?
We have a whole bunch of "make it compile" patches. A lot of it is stuff that we really need to fix (such as our lack of asprintf()). I just hadn't found time to separate out upstreamable stuff yet.
regards
john
Quoted 4 lines · Keir Fraser
* Didn't add -m32 to CFLAGS in hvmloader/Makefile. XEN_TARGET_ARCH=x86_32
should ensure that CFLAGS gets set up correctly anyway, and also there was no equivalent addition of -m32 to CFLAGS in vmxassist/Makefile, so I guess it's probably not needed at all.
You're right, this was vestigial.
Quoted 2 lines
* I couldn't fathom any of the changes to
tools/Makefile, so I didn't apply
any of them. Removing theXEN_ROOTassignment made no sense to me
Also vestigial, my apologies.
Quoted 2 lines
, and I don't understand the ioemu configuration changes. If they're in response to
It's necessary for building a 64-bit ioemu, otherwise it defaults to an i386-dm target, I think.
regards
john
Quoted 6 lines · John Levon
Quoted 2 lines
, and I don't understand the ioemu configuration changes. If they're in response to
It's necessary for building a 64-bit ioemu, otherwise it defaults to an i386-dm
target, I think.
We always configure i386-dm. We don't have different ioemu-dm for 32-bit versus 64-bit guests. Whether ioemu-dm is itself a 32-bit or 64-bit application is a separate issue (and we do get it right, on Linux at least).
-- Keir
Quoted 9 lines · Keir Fraser
Quoted 6 lines
Quoted 2 lines
, and I don't understand the ioemu configuration changes. If they're in response to
It's necessary for building a 64-bit ioemu, otherwise it defaults to an i386-dm
target, I think.We always configure i386-dm. We don't have different ioemu-dm for 32-bit versus 64-bit guests.
Hmm. Is there a difference in the targets then? Or does the change have no effect?
Quoted 2 lines
Whether ioemu-dm is itself a 32-bit or 64-bit
application is a separate issue (and we do get it right, on Linux at least).
Yes, even without the patch compiler flags etc. are right
regards
john
Quoted 5 lines · John Levon
Quoted 2 lines
We always configure i386-dm. We don't have different ioemu-dm for 32-bit versus 64-bit guests.
Hmm. Is there a difference in the targets then? Or does the change have no effect?
I haven't investigated qemu's build system enough to be sure, but I doubt it. We don't use any of qemu's normal CPU emulation code.
-- Keir