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-devel

Re: [Xen-devel] [PATCH] Partial fix for compat build non-portability

To: Keir Fraser <keir@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Partial fix for compat build non-portability
From: John Levon <levon@xxxxxxxxxxxxxxxxx>
Date: Thu, 11 Jan 2007 16:29:59 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 11 Jan 2007 08:28:00 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C1CADF11.76E2%keir@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20070110173719.GA31121@xxxxxxxxxxxxxxxxxxxxxxx> <C1CADF11.76E2%keir@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
On Wed, Jan 10, 2007 at 06:21:05PM +0000, Keir Fraser wrote:

> We only care about it working for the x86/64 target since that's the only
> one that asserts CONFIG_COMPAT. Why would wrapping structs individually be
> better than wrapping whole header files?

I've been building with the below, but haven't verified it's correct.

regards
john


# HG changeset patch
# User john.levon@xxxxxxx
# Date 1168532284 28800
# Node ID 30f9b54e54d444fa1f897257b6a35d8caabc8b6e
# Parent  cf35b1e695d68c4503784506ee62ceffcff69452
Enforce pragma pack(4) for the compat headers.

Signed-off-by: John Levon <john.levon@xxxxxxx>

diff --git a/xen/include/Makefile b/xen/include/Makefile
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -32,8 +32,8 @@ cppflags-$(CONFIG_X86)    += -m32
 cppflags-$(CONFIG_X86)    += -m32
 
 # 8-byte types are 4-byte aligned on x86_32 ...
-prefix-$(CONFIG_X86)      := \#pragma pack(push, 4)
-suffix-$(CONFIG_X86)      := \#pragma pack(pop)
+prefix-$(CONFIG_X86)      := \#pragma pack(4)
+suffix-$(CONFIG_X86)      := \#pragma pack()
 
 endif
 
diff --git a/xen/tools/compat-build-header.py b/xen/tools/compat-build-header.py
--- a/xen/tools/compat-build-header.py
+++ b/xen/tools/compat-build-header.py
@@ -3,7 +3,7 @@ import re,sys
 import re,sys
 
 pats = [
- [ r"__InClUdE__", r"#include" ],
+ [ r"__InClUdE__(.*)", r"#include\1\n#pragma pack(4)" ],
  [ r"\"xen-compat.h\"", r"<public/xen-compat.h>" ],
  [ r"(struct|union|enum)\s+(xen_?)?(\w)", r"\1 compat_\3" ],
  [ r"@KeeP@", r"" ],

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