ia64/xen-unstable
changeset 14451:0e0fdba35503
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>
- 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>
author | Keir Fraser <keir@xensource.com> |
---|---|
date | Sat Mar 17 12:04:48 2007 +0000 (2007-03-17) |
parents | 5a198ae89051 |
children | 98eacf1b075c |
files | Config.mk tools/Rules.mk xen/arch/x86/Rules.mk xen/common/perfc.c xen/include/public/arch-x86/xen-x86_32.h |
line diff
1.1 --- a/Config.mk Fri Mar 16 23:56:26 2007 +0000 1.2 +++ b/Config.mk Sat Mar 17 12:04:48 2007 +0000 1.3 @@ -36,6 +36,12 @@ endif 1.4 cc-option = $(shell if test -z "`$(1) $(2) -S -o /dev/null -xc \ 1.5 /dev/null 2>&1`"; then echo "$(2)"; else echo "$(3)"; fi ;) 1.6 1.7 +# cc-ver 1.8 +# Usage: ifeq ($(call cc-ver,$(CC),0x030400),y) 1.9 +cc-ver = $(shell if [ $$((`$(1) -dumpversion | awk -F. \ 1.10 + '{ printf "0x%02x%02x%02x", $$1, $$2, $$3}'`)) -ge $$(($(2))) ]; \ 1.11 + then echo y; else echo n; fi ;) 1.12 + 1.13 ifneq ($(debug),y) 1.14 CFLAGS += -DNDEBUG 1.15 else
2.1 --- a/tools/Rules.mk Fri Mar 16 23:56:26 2007 +0000 2.2 +++ b/tools/Rules.mk Sat Mar 17 12:04:48 2007 +0000 2.3 @@ -23,6 +23,11 @@ LDFLAGS += $(shell getconf LFS_LDFLAGS) 2.4 CFLAGS-$(CONFIG_X86_32) += $(call cc-option,$(CC),-mno-tls-direct-seg-refs) 2.5 CFLAGS += $(CFLAGS-y) 2.6 2.7 +# Require GCC v3.4+ (to avoid issues with alignment constraints in Xen headers) 2.8 +ifeq ($(CONFIG_X86)$(call cc-ver,$(CC),0x030400),yn) 2.9 +$(error Xen tools require at least gcc-3.4) 2.10 +endif 2.11 + 2.12 %.opic: %.c 2.13 $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $< 2.14
3.1 --- a/xen/arch/x86/Rules.mk Fri Mar 16 23:56:26 2007 +0000 3.2 +++ b/xen/arch/x86/Rules.mk Sat Mar 17 12:04:48 2007 +0000 3.3 @@ -58,19 +58,7 @@ HDRS += $(wildcard $(BASEDIR)/include/as 3.4 HDRS += $(wildcard $(BASEDIR)/include/asm-x86/hvm/svm/*.h) 3.5 HDRS += $(wildcard $(BASEDIR)/include/asm-x86/hvm/vmx/*.h) 3.6 3.7 -# Test for at least GCC v3.2.x. 3.8 -gcc-ver = $(shell $(CC) -dumpversion | sed -e 's/^\(.\)\.\(.\)\.\(.\)/\$(1)/') 3.9 -ifeq ($(call gcc-ver,1),1) 3.10 -$(error gcc-1.x.x unsupported - upgrade to at least gcc-3.2.x) 3.11 -endif 3.12 -ifeq ($(call gcc-ver,1),2) 3.13 -$(error gcc-2.x.x unsupported - upgrade to at least gcc-3.2.x) 3.14 +# Require GCC v3.4+ (to avoid issues with alignment constraints in Xen headers) 3.15 +ifneq ($(call cc-ver,$(CC),0x030400),y) 3.16 +$(error Xen requires at least gcc-3.4) 3.17 endif 3.18 -ifeq ($(call gcc-ver,1),3) 3.19 -ifeq ($(call gcc-ver,2),0) 3.20 -$(error gcc-3.0.x unsupported - upgrade to at least gcc-3.2.x) 3.21 -endif 3.22 -ifeq ($(call gcc-ver,2),1) 3.23 -$(error gcc-3.1.x unsupported - upgrade to at least gcc-3.2.x) 3.24 -endif 3.25 -endif
4.1 --- a/xen/common/perfc.c Fri Mar 16 23:56:26 2007 +0000 4.2 +++ b/xen/common/perfc.c Sat Mar 17 12:04:48 2007 +0000 4.3 @@ -136,8 +136,8 @@ static xen_sysctl_perfc_desc_t perfc_d[N 4.4 static xen_sysctl_perfc_val_t *perfc_vals; 4.5 static int perfc_nbr_vals; 4.6 static int perfc_init = 0; 4.7 -static int perfc_copy_info(XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t) desc, 4.8 - XEN_GUEST_HANDLE(xen_sysctl_perfc_val_t) val) 4.9 +static int perfc_copy_info(XEN_GUEST_HANDLE_64(xen_sysctl_perfc_desc_t) desc, 4.10 + XEN_GUEST_HANDLE_64(xen_sysctl_perfc_val_t) val) 4.11 { 4.12 unsigned int i, j; 4.13 unsigned int v = 0; 4.14 @@ -217,29 +217,20 @@ static int perfc_copy_info(XEN_GUEST_HAN 4.15 int perfc_control(xen_sysctl_perfc_op_t *pc) 4.16 { 4.17 static DEFINE_SPINLOCK(lock); 4.18 - XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t) desc; 4.19 - XEN_GUEST_HANDLE(xen_sysctl_perfc_val_t) val; 4.20 int rc; 4.21 4.22 - /* 4.23 - * 64 bit guest handles cannot be passed as parameters to 4.24 - * functions so cast to a regular guest handle. 4.25 - */ 4.26 - desc = guest_handle_cast(pc->desc, xen_sysctl_perfc_desc_t); 4.27 - val = guest_handle_cast(pc->val, xen_sysctl_perfc_val_t); 4.28 - 4.29 spin_lock(&lock); 4.30 4.31 switch ( pc->cmd ) 4.32 { 4.33 case XEN_SYSCTL_PERFCOP_reset: 4.34 - perfc_copy_info(desc, val); 4.35 + perfc_copy_info(pc->desc, pc->val); 4.36 perfc_reset(0); 4.37 rc = 0; 4.38 break; 4.39 4.40 case XEN_SYSCTL_PERFCOP_query: 4.41 - perfc_copy_info(desc, val); 4.42 + perfc_copy_info(pc->desc, pc->val); 4.43 rc = 0; 4.44 break; 4.45
5.1 --- a/xen/include/public/arch-x86/xen-x86_32.h Fri Mar 16 23:56:26 2007 +0000 5.2 +++ b/xen/include/public/arch-x86/xen-x86_32.h Sat Mar 17 12:04:48 2007 +0000 5.3 @@ -103,7 +103,7 @@ 5.4 (hnd).p = val; \ 5.5 } while ( 0 ) 5.6 #define uint64_aligned_t uint64_t __attribute__((aligned(8))) 5.7 -#define XEN_GUEST_HANDLE_64(name) __guest_handle_64_ ## name __attribute__((aligned(8))) 5.8 +#define XEN_GUEST_HANDLE_64(name) __guest_handle_64_ ## name 5.9 #endif 5.10 5.11 #ifndef __ASSEMBLY__