From: Bastian Blank <bastian@waldi.eu.org>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com, John Levon <levon@movementarian.org>
Subject: Re: [PATCH 1/4] tools - Remove machine setting from HOSTCFLAGS
Date: Sun, 27 Jan 2008 11:55:46 +0100 [thread overview]
Message-ID: <20080127105546.GA933@wavehammer.waldi.eu.org> (raw)
In-Reply-To: <C3C202B0.12E59%Keir.Fraser@cl.cam.ac.uk>
On Sun, Jan 27, 2008 at 09:43:12AM +0000, Keir Fraser wrote:
> On 26/1/08 19:34, "Bastian Blank" <bastian@waldi.eu.org> 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
next prev parent reply other threads:[~2008-01-27 10:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-26 19:34 [PATCH 1/4] tools - Remove machine setting from HOSTCFLAGS Bastian Blank
2008-01-27 9:43 ` Keir Fraser
2008-01-27 10:55 ` Bastian Blank [this message]
2008-01-27 11:09 ` Keir Fraser
2008-01-27 13:00 ` Keir Fraser
2008-01-27 16:12 ` Bastian Blank
2008-01-27 16:37 ` Keir Fraser
2008-01-27 16:46 ` Bastian Blank
2008-01-27 16:50 ` Keir Fraser
2008-01-27 17:07 ` Bastian Blank
2008-01-27 17:12 ` Bastian Blank
2008-01-27 17:21 ` Keir Fraser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080127105546.GA933@wavehammer.waldi.eu.org \
--to=bastian@waldi.eu.org \
--cc=Keir.Fraser@cl.cam.ac.uk \
--cc=levon@movementarian.org \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.