All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix cross compiling ia64 on x86
@ 2007-01-30 12:22 Isaku Yamahata
  2007-01-30 13:49 ` Gerd Hoffmann
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Isaku Yamahata @ 2007-01-30 12:22 UTC (permalink / raw)
  To: xen-devel; +Cc: xen-ia64-devel

[-- Attachment #1: Type: text/plain, Size: 163 bytes --]

fix cross-compile failure ia64 on x86 of c/s 13636:583441e296a1.
When cross-compiling ia64 on x86 box, compiling checker.c fails without
this patch.

-- 
yamahata

[-- Attachment #2: 13663_94c3db4748b2_cross_compilation_fix_13636_583441e296a1.patch --]
[-- Type: text/x-diff, Size: 1655 bytes --]

# HG changeset patch
# User yamahata@valinux.co.jp
# Date 1170143511 -32400
# Node ID 94c3db4748b2bf5867a1e3585c5edeb595875de2
# Parent  5bb0840984936749b4e99f53931d72a8579d302c
fix cross-compile failure ia64 on x86 of c/s 13636:583441e296a1.
When cross-compiling ia64 on x86 box, compiling checker.c fails without
this patch.
PATCHNAME: cross_compilation_fix_13636_583441e296a1

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>

diff -r 5bb084098493 -r 94c3db4748b2 xen/include/public/foreign/Makefile
--- a/xen/include/public/foreign/Makefile	Mon Jan 29 13:22:21 2007 +0000
+++ b/xen/include/public/foreign/Makefile	Tue Jan 30 16:51:51 2007 +0900
@@ -14,12 +14,8 @@ clean:
 	rm -f *.pyc *.o *~
 
 check-headers: checker
-ifeq ($(CROSS_COMPILE),)
 	./checker > $(XEN_TARGET_ARCH).size
 	diff -u reference.size $(XEN_TARGET_ARCH).size
-else
-	@echo "cross build: skipping check"
-endif
 
 x86_32.h: ../arch-x86/xen-x86_32.h ../arch-x86/xen.h ../xen.h $(scripts)
 	python mkheader.py $* $@ $(filter %.h,$^)
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");

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix cross compiling ia64 on x86
  2007-01-30 12:22 [PATCH] fix cross compiling ia64 on x86 Isaku Yamahata
@ 2007-01-30 13:49 ` Gerd Hoffmann
  2007-01-31  2:26   ` Isaku Yamahata
  2007-01-30 13:55 ` [PATCH] fix cross compiling ia64 on x86 Keir Fraser
  2007-01-30 14:24 ` [Xen-devel] " Keir Fraser
  2 siblings, 1 reply; 8+ messages in thread
From: Gerd Hoffmann @ 2007-01-30 13:49 UTC (permalink / raw)
  To: Isaku Yamahata; +Cc: xen-devel, xen-ia64-devel

> diff -r 5bb084098493 -r 94c3db4748b2 xen/include/public/foreign/Makefile
> --- a/xen/include/public/foreign/Makefile	Mon Jan 29 13:22:21 2007 +0000
> +++ b/xen/include/public/foreign/Makefile	Tue Jan 30 16:51:51 2007 +0900
> @@ -14,12 +14,8 @@ clean:
>  	rm -f *.pyc *.o *~
>  
>  check-headers: checker
> -ifeq ($(CROSS_COMPILE),)
>  	./checker > $(XEN_TARGET_ARCH).size
>  	diff -u reference.size $(XEN_TARGET_ARCH).size
> -else
> -	@echo "cross build: skipping check"
> -endif
>  
>  x86_32.h: ../arch-x86/xen-x86_32.h ../arch-x86/xen.h ../xen.h $(scripts)
>  	python mkheader.py $* $@ $(filter %.h,$^)

Ok.

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

cheers,
  Gerd

-- 
Gerd Hoffmann <kraxel@suse.de>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix cross compiling ia64 on x86
  2007-01-30 12:22 [PATCH] fix cross compiling ia64 on x86 Isaku Yamahata
  2007-01-30 13:49 ` Gerd Hoffmann
@ 2007-01-30 13:55 ` Keir Fraser
  2007-01-30 13:56   ` Keir Fraser
  2007-01-30 14:24 ` [Xen-devel] " Keir Fraser
  2 siblings, 1 reply; 8+ messages in thread
From: Keir Fraser @ 2007-01-30 13:55 UTC (permalink / raw)
  To: Isaku Yamahata, xen-devel; +Cc: Gerd Hoffmann, xen-ia64-devel

On 30/1/07 12:22 pm, "Isaku Yamahata" <yamahata@valinux.co.jp> wrote:

> fix cross-compile failure ia64 on x86 of c/s 13636:583441e296a1.
> When cross-compiling ia64 on x86 box, compiling checker.c fails without
> this patch.

Applied, but adding a new 'middle' hook is unfortunate. Is there perhaps a
better name we could pick? Or perhaps Gerd has a better idea how to fit
ia64's needs?

 -- Keir

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix cross compiling ia64 on x86
  2007-01-30 13:55 ` [PATCH] fix cross compiling ia64 on x86 Keir Fraser
@ 2007-01-30 13:56   ` Keir Fraser
  0 siblings, 0 replies; 8+ messages in thread
From: Keir Fraser @ 2007-01-30 13:56 UTC (permalink / raw)
  To: Isaku Yamahata, xen-devel; +Cc: Gerd Hoffmann, xen-ia64-devel

On 30/1/07 1:55 pm, "Keir Fraser" <Keir.Fraser@cl.cam.ac.uk> wrote:

> On 30/1/07 12:22 pm, "Isaku Yamahata" <yamahata@valinux.co.jp> wrote:
> 
>> fix cross-compile failure ia64 on x86 of c/s 13636:583441e296a1.
>> When cross-compiling ia64 on x86 box, compiling checker.c fails without
>> this patch.
> 
> Applied, but adding a new 'middle' hook is unfortunate. Is there perhaps a
> better name we could pick? Or perhaps Gerd has a better idea how to fit ia64's
> needs?

Replied to the wrong patch email. I'm talking about your patch to the domain
builder of course! :-)

 -- Keir

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Xen-devel] [PATCH] fix cross compiling ia64 on x86
  2007-01-30 12:22 [PATCH] fix cross compiling ia64 on x86 Isaku Yamahata
  2007-01-30 13:49 ` Gerd Hoffmann
  2007-01-30 13:55 ` [PATCH] fix cross compiling ia64 on x86 Keir Fraser
@ 2007-01-30 14:24 ` Keir Fraser
  2 siblings, 0 replies; 8+ messages in thread
From: Keir Fraser @ 2007-01-30 14:24 UTC (permalink / raw)
  To: Isaku Yamahata, xen-devel; +Cc: xen-ia64-devel




On 30/1/07 12:22 pm, "Isaku Yamahata" <yamahata@valinux.co.jp> wrote:

> fix cross-compile failure ia64 on x86 of c/s 13636:583441e296a1.
> When cross-compiling ia64 on x86 box, compiling checker.c fails without
> this patch.

I excluded the change to mkchecker.py. Apart from Gerd commenting on it, it
looked dodgy to me too (I can't see why that logic would depend on
build-host architecture).

 -- Keir

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix cross compiling ia64 on x86
  2007-01-30 13:49 ` Gerd Hoffmann
@ 2007-01-31  2:26   ` Isaku Yamahata
  2007-01-31 11:30     ` Gerd Hoffmann
  0 siblings, 1 reply; 8+ messages in thread
From: Isaku Yamahata @ 2007-01-31  2:26 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: xen-devel, xen-ia64-devel

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@valinux.co.jp
# 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@valinux.co.jp>

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix cross compiling ia64 on x86
  2007-01-31  2:26   ` Isaku Yamahata
@ 2007-01-31 11:30     ` Gerd Hoffmann
  2007-02-01  2:55       ` [PATCH] fix corss compile ia64 build on x86 (Re: [PATCH] fix cross compiling ia64 on x86) Isaku Yamahata
  0 siblings, 1 reply; 8+ messages in thread
From: Gerd Hoffmann @ 2007-01-31 11:30 UTC (permalink / raw)
  To: Isaku Yamahata; +Cc: xen-devel, xen-ia64-devel

  Hi,

> Without this hunk, checker.c doesn't compile because checker.c is copmiled
> by HOSTCC, not CC.
> How about the following patch?

Looks ok to me.  The whole sanity check doesn't work anyway when
cross-compiling, so not trying to build it in the first place is fine.

cheers,
  Gerd

-- 
Gerd Hoffmann <kraxel@suse.de>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] fix corss compile ia64 build on x86 (Re: [PATCH] fix cross compiling ia64 on x86)
  2007-01-31 11:30     ` Gerd Hoffmann
@ 2007-02-01  2:55       ` Isaku Yamahata
  0 siblings, 0 replies; 8+ messages in thread
From: Isaku Yamahata @ 2007-02-01  2:55 UTC (permalink / raw)
  To: xen-devel; +Cc: xen-ia64-devel

[-- Attachment #1: Type: text/plain, Size: 654 bytes --]

The previous patch doesn't apply cleanly. 
Here is the updated one.


On Wed, Jan 31, 2007 at 12:30:37PM +0100, Gerd Hoffmann wrote:
>   Hi,
> 
> > Without this hunk, checker.c doesn't compile because checker.c is copmiled
> > by HOSTCC, not CC.
> > How about the following patch?
> 
> Looks ok to me.  The whole sanity check doesn't work anyway when
> cross-compiling, so not trying to build it in the first place is fine.
> 
> cheers,
>   Gerd
> 
> -- 
> Gerd Hoffmann <kraxel@suse.de>
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
> 

-- 
yamahata

[-- Attachment #2: 13763_3751a96ba021_fix_cross_ia64_on_x86.patch --]
[-- Type: text/x-diff, Size: 1306 bytes --]

# HG changeset patch
# User yamahata@valinux.co.jp
# Date 1170298248 -32400
# Node ID 3751a96ba0217690b4f1fedc577ed4d45a7b456e
# Parent  588dd80b56b5411bd9d1860e9e19da39a64e2f5d
fix cross-compile. ia64 build on x86
PATCHNAME: fix_cross_ia64_on_x86

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>

diff -r 588dd80b56b5 -r 3751a96ba021 xen/include/public/foreign/Makefile
--- a/xen/include/public/foreign/Makefile	Wed Jan 31 19:37:44 2007 +0000
+++ b/xen/include/public/foreign/Makefile	Thu Feb 01 11:50:48 2007 +0900
@@ -13,9 +13,16 @@ clean:
 	rm -f checker checker.c $(XEN_TARGET_ARCH).size
 	rm -f *.pyc *.o *~
 
+ifeq ($(CROSS_COMPILE),)
 check-headers: checker
 	./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
 
 x86_32.h: ../arch-x86/xen-x86_32.h ../arch-x86/xen.h ../xen.h $(scripts)
 	python mkheader.py $* $@ $(filter %.h,$^)
@@ -26,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)

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-02-01  2:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-30 12:22 [PATCH] fix cross compiling ia64 on x86 Isaku Yamahata
2007-01-30 13:49 ` Gerd Hoffmann
2007-01-31  2:26   ` Isaku Yamahata
2007-01-31 11:30     ` Gerd Hoffmann
2007-02-01  2:55       ` [PATCH] fix corss compile ia64 build on x86 (Re: [PATCH] fix cross compiling ia64 on x86) Isaku Yamahata
2007-01-30 13:55 ` [PATCH] fix cross compiling ia64 on x86 Keir Fraser
2007-01-30 13:56   ` Keir Fraser
2007-01-30 14:24 ` [Xen-devel] " Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.