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

Re: [Xen-devel] [PATCH] fix cross compiling ia64 on x86

To: Gerd Hoffmann <kraxel@xxxxxxx>
Subject: Re: [Xen-devel] [PATCH] fix cross compiling ia64 on x86
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Wed, 31 Jan 2007 11:26:34 +0900
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 30 Jan 2007 18:26:31 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <45BF4CDA.1090103@xxxxxxx>
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: <20070130122214.GH25482%yamahata@xxxxxxxxxxxxx> <45BF4CDA.1090103@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
On Tue, Jan 30, 2007 at 02:49:14PM +0100, Gerd Hoffmann wrote:
> > diff -r 5bb084098493 -r 94c3db4748b2 xen/include/public/foreign/mkchecker.py
> > --- a/xen/include/public/foreign/mkchecker.py       Mon Jan 29 13:22:21 
> > 2007 +0000
> > +++ b/xen/include/public/foreign/mkchecker.py       Tue Jan 30 16:51:51 
> > 2007 +0900
> > @@ -38,10 +38,7 @@ for struct in structs:
> >  for struct in structs:
> >      f.write('\tprintf("%%-20s |", "%s");\n' % struct);
> >      for a in archs:
> > -        if a == arch:
> > -            s = struct; # native
> > -        else:
> > -            s = struct + "_" + a;
> > +        s = struct + "_" + a;
> >          f.write('#ifdef %s_has_no_%s\n' % (a, struct));
> >          f.write('\tprintf("%8s", "-");\n');
> >          f.write("#else\n");
> 
> No.  I intentionally use the native version here (struct foo instead of
> struct foo_arch) to catch possible inconsistencies.

Without this hunk, checker.c doesn't compile because checker.c is copmiled
by HOSTCC, not CC.

make[1]: Entering directory 
`/src1/yamahata/hg/xen/mkpatch/cross_compile/xen-unstable.hg/xen/include/public/foreign'
python mkheader.py x86_32 x86_32.h ../arch-x86/xen-x86_32.h ../arch-x86/xen.h 
../xen.h
python mkheader.py x86_64 x86_64.h ../arch-x86/xen-x86_64.h ../arch-x86/xen.h 
../xen.h
python mkheader.py ia64 ia64.h ../arch-ia64.h ../xen.h
python mkchecker.py ia64 checker.c x86_32 x86_64 ia64
gcc -O2 -fomit-frame-pointer -DNDEBUG -std=gnu99 -Wall -Wstrict-prototypes 
-Wno-unused-value -Wdeclaration-after-statement  -D__XEN_TOOLS__ 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE 
-D_LARGEFILE64_SOURCE  -o checker checker.c
checker.c: In function 'main':
checker.c:72: error: invalid application of 'sizeof' to incomplete type 'struct 
pt_fpreg' 
checker.c:108: error: invalid application of 'sizeof' to incomplete type 
'struct xen_ia64_boot_param' 
checker.c:126: error: invalid application of 'sizeof' to incomplete type 
'struct ia64_tr_entry' 
checker.c:144: error: invalid application of 'sizeof' to incomplete type 
'struct vcpu_extra_regs' 
make[1]: *** [checker] Error 1
make[1]: Leaving directory 
`/src1/yamahata/hg/xen/mkpatch/cross_compile/xen-unstable.hg/xen/include/public/foreign'
make: *** [build-headers] Error 2

How about the following patch?
Since The first hunk of the previous patch was committed to
the staging tree, this might not apply cleanly though.

# HG changeset patch
# User yamahata@xxxxxxxxxxxxx
# Date 1170210228 -32400
# Node ID 90331c4df8af3114a4eda8aab0c59b83f7ef600c
# Parent  5e8da0663ff863c9de8948b72399e591f34828a2
fix cross ia64 build on x86.
PATCHNAME: fix_cross_ia64_on_x86

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff -r 5e8da0663ff8 -r 90331c4df8af xen/include/public/foreign/Makefile
--- a/xen/include/public/foreign/Makefile       Tue Jan 30 01:23:58 2007 +0000
+++ b/xen/include/public/foreign/Makefile       Wed Jan 31 11:23:48 2007 +0900
@@ -13,11 +13,14 @@ clean:
        rm -f checker checker.c $(XEN_TARGET_ARCH).size
        rm -f *.pyc *.o *~
 
+ifeq ($(CROSS_COMPILE),)
 check-headers: checker
-ifeq ($(CROSS_COMPILE),)
        ./checker > $(XEN_TARGET_ARCH).size
        diff -u reference.size $(XEN_TARGET_ARCH).size
+checker: checker.c $(headers)
+       $(HOSTCC) $(CFLAGS) -o $@ $<
 else
+check-headers:
        @echo "cross build: skipping check"
 endif
 
@@ -30,8 +33,5 @@ ia64.h: ../arch-ia64.h ../xen.h $(script
 ia64.h: ../arch-ia64.h ../xen.h $(scripts)
        python mkheader.py $* $@ $(filter %.h,$^)
 
-checker: checker.c $(headers)
-       $(HOSTCC) $(CFLAGS) -o $@ $<
-
 checker.c: $(scripts)
        python mkchecker.py $(XEN_TARGET_ARCH) $@ $(architectures)


-- 
yamahata

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