aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir@xensource.com>2007-03-17 12:04:48 +0000
committerKeir Fraser <keir@xensource.com>2007-03-17 12:04:48 +0000
commitcfcf0ae28495b1fff0f16981822b1a93b9336c7a (patch)
tree0b5c11150b92066f53d41dc90dc9fb588724ad3a
parent36200329b198717624bfa37f410e3a650168a9c7 (diff)
downloadxen-cfcf0ae28495b1fff0f16981822b1a93b9336c7a.tar.gz
xen-cfcf0ae28495b1fff0f16981822b1a93b9336c7a.tar.bz2
xen-cfcf0ae28495b1fff0f16981822b1a93b9336c7a.zip
Xen and tools now require gcc 3.4+ on x86.
- gcc-3.2 cannot handle some multi-line assertions in the Xen sources. Noone noticed. - gcc-3.3 has problems with alignment constraints inside typedefs. gcc 3.4.0 is now three years old so I hope that everyone has an up-to-date compiler, or can obtain a more up-to-date package for their distribution. If not we may need to fall back to supporting gcc-3.3.x as well. Also clean up the way we do version checks, using the power of awk. Signed-off-by: Keir Fraser <keir@xensource.com>
-rw-r--r--Config.mk6
-rw-r--r--tools/Rules.mk5
-rw-r--r--xen/arch/x86/Rules.mk18
-rw-r--r--xen/common/perfc.c17
-rw-r--r--xen/include/public/arch-x86/xen-x86_32.h2
5 files changed, 19 insertions, 29 deletions
diff --git a/Config.mk b/Config.mk
index 6f9f970fe6..0181cc3ad1 100644
--- a/Config.mk
+++ b/Config.mk
@@ -36,6 +36,12 @@ endif
cc-option = $(shell if test -z "`$(1) $(2) -S -o /dev/null -xc \
/dev/null 2>&1`"; then echo "$(2)"; else echo "$(3)"; fi ;)
+# cc-ver
+# Usage: ifeq ($(call cc-ver,$(CC),0x030400),y)
+cc-ver = $(shell if [ $$((`$(1) -dumpversion | awk -F. \
+ '{ printf "0x%02x%02x%02x", $$1, $$2, $$3}'`)) -ge $$(($(2))) ]; \
+ then echo y; else echo n; fi ;)
+
ifneq ($(debug),y)
CFLAGS += -DNDEBUG
else
diff --git a/tools/Rules.mk b/tools/Rules.mk
index df3b231a1a..3e13eceb55 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -23,6 +23,11 @@ LDFLAGS += $(shell getconf LFS_LDFLAGS)
CFLAGS-$(CONFIG_X86_32) += $(call cc-option,$(CC),-mno-tls-direct-seg-refs)
CFLAGS += $(CFLAGS-y)
+# Require GCC v3.4+ (to avoid issues with alignment constraints in Xen headers)
+ifeq ($(CONFIG_X86)$(call cc-ver,$(CC),0x030400),yn)
+$(error Xen tools require at least gcc-3.4)
+endif
+
%.opic: %.c
$(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $<
diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index 899f28129c..86b9f33ab1 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -58,19 +58,7 @@ HDRS += $(wildcard $(BASEDIR)/include/asm-x86/hvm/*.h)
HDRS += $(wildcard $(BASEDIR)/include/asm-x86/hvm/svm/*.h)
HDRS += $(wildcard $(BASEDIR)/include/asm-x86/hvm/vmx/*.h)
-# Test for at least GCC v3.2.x.
-gcc-ver = $(shell $(CC) -dumpversion | sed -e 's/^\(.\)\.\(.\)\.\(.\)/\$(1)/')
-ifeq ($(call gcc-ver,1),1)
-$(error gcc-1.x.x unsupported - upgrade to at least gcc-3.2.x)
-endif
-ifeq ($(call gcc-ver,1),2)
-$(error gcc-2.x.x unsupported - upgrade to at least gcc-3.2.x)
-endif
-ifeq ($(call gcc-ver,1),3)
-ifeq ($(call gcc-ver,2),0)
-$(error gcc-3.0.x unsupported - upgrade to at least gcc-3.2.x)
-endif
-ifeq ($(call gcc-ver,2),1)
-$(error gcc-3.1.x unsupported - upgrade to at least gcc-3.2.x)
-endif
+# Require GCC v3.4+ (to avoid issues with alignment constraints in Xen headers)
+ifneq ($(call cc-ver,$(CC),0x030400),y)
+$(error Xen requires at least gcc-3.4)
endif
diff --git a/xen/common/perfc.c b/xen/common/perfc.c
index d5bcd9b2e1..bbff5d7b5c 100644
--- a/xen/common/perfc.c
+++ b/xen/common/perfc.c
@@ -136,8 +136,8 @@ static xen_sysctl_perfc_desc_t perfc_d[NR_PERFCTRS];
static xen_sysctl_perfc_val_t *perfc_vals;
static int perfc_nbr_vals;
static int perfc_init = 0;
-static int perfc_copy_info(XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t) desc,
- XEN_GUEST_HANDLE(xen_sysctl_perfc_val_t) val)
+static int perfc_copy_info(XEN_GUEST_HANDLE_64(xen_sysctl_perfc_desc_t) desc,
+ XEN_GUEST_HANDLE_64(xen_sysctl_perfc_val_t) val)
{
unsigned int i, j;
unsigned int v = 0;
@@ -217,29 +217,20 @@ static int perfc_copy_info(XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t) desc,
int perfc_control(xen_sysctl_perfc_op_t *pc)
{
static DEFINE_SPINLOCK(lock);
- XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t) desc;
- XEN_GUEST_HANDLE(xen_sysctl_perfc_val_t) val;
int rc;
- /*
- * 64 bit guest handles cannot be passed as parameters to
- * functions so cast to a regular guest handle.
- */
- desc = guest_handle_cast(pc->desc, xen_sysctl_perfc_desc_t);
- val = guest_handle_cast(pc->val, xen_sysctl_perfc_val_t);
-
spin_lock(&lock);
switch ( pc->cmd )
{
case XEN_SYSCTL_PERFCOP_reset:
- perfc_copy_info(desc, val);
+ perfc_copy_info(pc->desc, pc->val);
perfc_reset(0);
rc = 0;
break;
case XEN_SYSCTL_PERFCOP_query:
- perfc_copy_info(desc, val);
+ perfc_copy_info(pc->desc, pc->val);
rc = 0;
break;
diff --git a/xen/include/public/arch-x86/xen-x86_32.h b/xen/include/public/arch-x86/xen-x86_32.h
index 2633ff082f..6728b818cd 100644
--- a/xen/include/public/arch-x86/xen-x86_32.h
+++ b/xen/include/public/arch-x86/xen-x86_32.h
@@ -103,7 +103,7 @@
(hnd).p = val; \
} while ( 0 )
#define uint64_aligned_t uint64_t __attribute__((aligned(8)))
-#define XEN_GUEST_HANDLE_64(name) __guest_handle_64_ ## name __attribute__((aligned(8)))
+#define XEN_GUEST_HANDLE_64(name) __guest_handle_64_ ## name
#endif
#ifndef __ASSEMBLY__