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>
This commit is contained in:
Keir Fraser committed 2007-03-17 12:04:48 +00:00
1 parent 36200329b1
commit cfcf0ae284
5 files changed
+19 -29

No files matched your search

+6
View File
@@ -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
+5
View File
@@ -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 $@ $<
+3 -15
View File
@@ -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
+4 -13
View File
@@ -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;
+1 -1
View File
@@ -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__
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.