[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 1/4] tools - Remove machine setting from HOSTCFLAGS



On Sun, Jan 27, 2008 at 09:43:12AM +0000, Keir Fraser wrote:
> On 26/1/08 19:34, "Bastian Blank" <bastian@xxxxxxxxxxxx> wrote:
> > Remove machine setting from HOSTCFLAGS.
> > 
> > The host compiler must know how to produce runnable binaries without
> > special settings.
> Unfortunately those lines *were* introduced for a reason. See the thread at
> http://lists.xensource.com/archives/html/xen-devel/2007-08/msg00342.html. In
> brief summary, the HOSTCFLAGS mod ensures that Solaris gcc produces 64-bit
> binaries when COMPILE_ARCH==x86_64; a sane thing to do you'll agree.

Your summary not complete. The build assumes the HOSTCC is able to
produce binaries which both run on the host and match the target
environment.

> We could move the HOSTCFLAGS modification to config/SunOS.mk. Or to
> tools/include/xen-foreign/Makefile. But actually afaict doing it globally in
> Config.mk is harmless, it just looks a bit odd and potentially purgable. :-)

It just missuses the name HOST, IMHO.

Anyway, why not the following patch? It removes the special case in
mkchecker.py and always checks if all _translated_ structs have the
correct size. This should catch both error cases: orig struct was
changed and translation is broken. Also it can run always now. Or is
it a fix for something else to do the check this way and forget the
translated one?

diff -r 52dd15058648 tools/include/xen-foreign/Makefile
--- a/tools/include/xen-foreign/Makefile        Sat Jan 26 20:58:54 2008 +0100
+++ b/tools/include/xen-foreign/Makefile        Sun Jan 27 10:49:04 2008 +0000
@@ -18,7 +18,6 @@ clean:
        rm -f checker checker.c
        rm -f *.pyc *.o *~
 
-ifeq ($(CROSS_COMPILE)$(XEN_TARGET_ARCH),$(XEN_COMPILE_ARCH))
 checker: checker.c $(headers)
        $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
 
@@ -26,10 +25,6 @@ check-headers: checker
        ./checker > tmp.size
        diff -u $(ROOT)/foreign/reference.size tmp.size
        rm tmp.size
-else
-check-headers:
-       @echo "cross build: skipping check"
-endif
 
 x86_32.h: $(MKHEADER_PY) $(ROOT)/arch-x86/xen-x86_32.h $(ROOT)/arch-x86/xen.h 
$(ROOT)/xen.h
        python $< $* $@ $(filter %.h,$^)
@@ -41,4 +36,4 @@ ia64.h: $(MKHEADER_PY) $(ROOT)/arch-ia64
        python $< $* $@ $(filter %.h,$^)
 
 checker.c: $(MKCHECKER_PY)
-       python $< $(XEN_TARGET_ARCH) $@ $(architectures)
+       python $< $@ $(architectures)
diff -r 52dd15058648 xen/include/public/foreign/mkchecker.py
--- a/xen/include/public/foreign/mkchecker.py   Sat Jan 26 20:58:54 2008 +0100
+++ b/xen/include/public/foreign/mkchecker.py   Sun Jan 27 10:49:04 2008 +0000
@@ -4,9 +4,8 @@ from structs import structs;
 from structs import structs;
 
 # command line arguments
-arch    = sys.argv[1];
-outfile = sys.argv[2];
-archs   = sys.argv[3:];
+outfile = sys.argv[1];
+archs   = sys.argv[2:];
 
 f = open(outfile, "w");
 f.write('''
@@ -38,10 +37,7 @@ for struct in structs:
 for struct in structs:
     f.write('\tprintf("%%-25s |", "%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");

Bastian

-- 
Vulcans do not approve of violence.
                -- Spock, "Journey to Babel", stardate 3842.4

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.