WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Xen and tools now require gcc 3.4+ on x86

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Xen and tools now require gcc 3.4+ on x86.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 17 Mar 2007 10:00:20 -0700
Delivery-date: Sat, 17 Mar 2007 09:59:15 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1174133088 0
# Node ID 0e0fdba35503fa7eed5700faf90f6ab0838e13e3
# Parent  5a198ae8905164022f486b07f55a649ee92b6726
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@xxxxxxxxxxxxx>
---
 Config.mk                                |    6 ++++++
 tools/Rules.mk                           |    5 +++++
 xen/arch/x86/Rules.mk                    |   18 +++---------------
 xen/common/perfc.c                       |   17 ++++-------------
 xen/include/public/arch-x86/xen-x86_32.h |    2 +-
 5 files changed, 19 insertions(+), 29 deletions(-)

diff -r 5a198ae89051 -r 0e0fdba35503 Config.mk
--- a/Config.mk Fri Mar 16 23:56:26 2007 +0000
+++ b/Config.mk Sat Mar 17 12:04:48 2007 +0000
@@ -35,6 +35,12 @@ endif
 # Usage: cflags-y += $(call cc-option,$(CC),-march=winchip-c6,-march=i586)
 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
diff -r 5a198ae89051 -r 0e0fdba35503 tools/Rules.mk
--- a/tools/Rules.mk    Fri Mar 16 23:56:26 2007 +0000
+++ b/tools/Rules.mk    Sat Mar 17 12:04:48 2007 +0000
@@ -22,6 +22,11 @@ LDFLAGS += $(shell getconf LFS_LDFLAGS)
 # 32-bit x86 does not perform well with -ve segment accesses on Xen.
 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 -r 5a198ae89051 -r 0e0fdba35503 xen/arch/x86/Rules.mk
--- a/xen/arch/x86/Rules.mk     Fri Mar 16 23:56:26 2007 +0000
+++ b/xen/arch/x86/Rules.mk     Sat Mar 17 12:04:48 2007 +0000
@@ -58,19 +58,7 @@ HDRS += $(wildcard $(BASEDIR)/include/as
 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)
+# 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
-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
-endif
diff -r 5a198ae89051 -r 0e0fdba35503 xen/common/perfc.c
--- a/xen/common/perfc.c        Fri Mar 16 23:56:26 2007 +0000
+++ b/xen/common/perfc.c        Sat Mar 17 12:04:48 2007 +0000
@@ -136,8 +136,8 @@ static xen_sysctl_perfc_val_t *perfc_val
 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 @@ int perfc_control(xen_sysctl_perfc_op_t 
 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 -r 5a198ae89051 -r 0e0fdba35503 xen/include/public/arch-x86/xen-x86_32.h
--- a/xen/include/public/arch-x86/xen-x86_32.h  Fri Mar 16 23:56:26 2007 +0000
+++ b/xen/include/public/arch-x86/xen-x86_32.h  Sat Mar 17 12:04:48 2007 +0000
@@ -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__

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Xen and tools now require gcc 3.4+ on x86., Xen patchbot-unstable <=