* [PATCH 1/4] tools - Remove machine setting from HOSTCFLAGS
@ 2008-01-26 19:34 Bastian Blank
2008-01-27 9:43 ` Keir Fraser
0 siblings, 1 reply; 12+ messages in thread
From: Bastian Blank @ 2008-01-26 19:34 UTC (permalink / raw)
To: xen-devel
# HG changeset patch
# User Bastian Blank <waldi@debian.org>
# Date 1201375662 -3600
# Node ID 15419f59710aeaaf83fc35fbbf955b15ec713051
# Parent c98a1a50be44c52cb59b5795347bf852941b4fdc
Remove machine setting from HOSTCFLAGS.
The host compiler must know how to produce runnable binaries without
special settings.
Signed-off-by: Bastian Blank <waldi@debian.org>
diff -r c98a1a50be44 -r 15419f59710a Config.mk
--- a/Config.mk Sat Jan 26 20:27:42 2008 +0100
+++ b/Config.mk Sat Jan 26 20:27:42 2008 +0100
@@ -21,9 +21,6 @@ HOSTCC = gcc
HOSTCC = gcc
HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
HOSTCFLAGS += -fno-strict-aliasing
-HOSTCFLAGS_x86_32 = -m32
-HOSTCFLAGS_x86_64 = -m64
-HOSTCFLAGS += $(HOSTCFLAGS_$(XEN_COMPILE_ARCH))
DISTDIR ?= $(XEN_ROOT)/dist
DESTDIR ?= /
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/4] tools - Remove machine setting from HOSTCFLAGS
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
0 siblings, 1 reply; 12+ messages in thread
From: Keir Fraser @ 2008-01-27 9:43 UTC (permalink / raw)
To: Bastian Blank, xen-devel; +Cc: John Levon
On 26/1/08 19:34, "Bastian Blank" <bastian@waldi.eu.org> wrote:
> # HG changeset patch
> # User Bastian Blank <waldi@debian.org>
> # Date 1201375662 -3600
> # Node ID 15419f59710aeaaf83fc35fbbf955b15ec713051
> # Parent c98a1a50be44c52cb59b5795347bf852941b4fdc
> Remove machine setting from HOSTCFLAGS.
>
> The host compiler must know how to produce runnable binaries without
> special settings.
>
> Signed-off-by: Bastian Blank <waldi@debian.org>
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.
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. :-)
-- Keir
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/4] tools - Remove machine setting from HOSTCFLAGS
2008-01-27 9:43 ` Keir Fraser
@ 2008-01-27 10:55 ` Bastian Blank
2008-01-27 11:09 ` Keir Fraser
2008-01-27 13:00 ` Keir Fraser
0 siblings, 2 replies; 12+ messages in thread
From: Bastian Blank @ 2008-01-27 10:55 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel, John Levon
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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/4] tools - Remove machine setting from HOSTCFLAGS
2008-01-27 10:55 ` Bastian Blank
@ 2008-01-27 11:09 ` Keir Fraser
2008-01-27 13:00 ` Keir Fraser
1 sibling, 0 replies; 12+ messages in thread
From: Keir Fraser @ 2008-01-27 11:09 UTC (permalink / raw)
To: Bastian Blank; +Cc: xen-devel, John Levon
On 27/1/08 10:55, "Bastian Blank" <bastian@waldi.eu.org> wrote:
>> 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.
Not sure what you mean? You think HOSTCC needs special casing too?
>> 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?
Your patch might make sense. I'll take a look.
-- Keir
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/4] tools - Remove machine setting from HOSTCFLAGS
2008-01-27 10:55 ` Bastian Blank
2008-01-27 11:09 ` Keir Fraser
@ 2008-01-27 13:00 ` Keir Fraser
2008-01-27 16:12 ` Bastian Blank
1 sibling, 1 reply; 12+ messages in thread
From: Keir Fraser @ 2008-01-27 13:00 UTC (permalink / raw)
To: Bastian Blank; +Cc: xen-devel, John Levon
On 27/1/08 10:55, "Bastian Blank" <bastian@waldi.eu.org> wrote:
> 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?
Yes, I think this patch makes sense so I checked it in.
I still don't understand why you'd want to remove -m32/-m64 from HOSTCFLAGS
though. Is it just a cleanliness thing, or does it break something for you?
-- Keir
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/4] tools - Remove machine setting from HOSTCFLAGS
2008-01-27 13:00 ` Keir Fraser
@ 2008-01-27 16:12 ` Bastian Blank
2008-01-27 16:37 ` Keir Fraser
0 siblings, 1 reply; 12+ messages in thread
From: Bastian Blank @ 2008-01-27 16:12 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel, John Levon
On Sun, Jan 27, 2008 at 01:00:14PM +0000, Keir Fraser wrote:
> I still don't understand why you'd want to remove -m32/-m64 from HOSTCFLAGS
> though. Is it just a cleanliness thing, or does it break something for you?
It fails for me sometimes if I forget to say that the system is not able
to run x86_64 binaries.
Bastian
--
I object to intellect without discipline; I object to power without
constructive purpose.
-- Spock, "The Squire of Gothos", stardate 2124.5
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/4] tools - Remove machine setting from HOSTCFLAGS
2008-01-27 16:12 ` Bastian Blank
@ 2008-01-27 16:37 ` Keir Fraser
2008-01-27 16:46 ` Bastian Blank
0 siblings, 1 reply; 12+ messages in thread
From: Keir Fraser @ 2008-01-27 16:37 UTC (permalink / raw)
To: Bastian Blank; +Cc: xen-devel
On 27/1/08 16:12, "Bastian Blank" <bastian@waldi.eu.org> wrote:
> On Sun, Jan 27, 2008 at 01:00:14PM +0000, Keir Fraser wrote:
>> I still don't understand why you'd want to remove -m32/-m64 from HOSTCFLAGS
>> though. Is it just a cleanliness thing, or does it break something for you?
>
> It fails for me sometimes if I forget to say that the system is not able
> to run x86_64 binaries.
Then you would not have 'uname -m' indicating x86_64 or amd64, and so
XEN_COMPILE_ARCH would be x86_32 by default?
-- Keir
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/4] tools - Remove machine setting from HOSTCFLAGS
2008-01-27 16:37 ` Keir Fraser
@ 2008-01-27 16:46 ` Bastian Blank
2008-01-27 16:50 ` Keir Fraser
0 siblings, 1 reply; 12+ messages in thread
From: Bastian Blank @ 2008-01-27 16:46 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel
On Sun, Jan 27, 2008 at 04:37:22PM +0000, Keir Fraser wrote:
> Then you would not have 'uname -m' indicating x86_64 or amd64, and so
> XEN_COMPILE_ARCH would be x86_32 by default?
No. uname -m == x86_64 and XEN_TARGET_ARCH = x86_64, but the system
lacks critical parts to execute the x86_64 binaries.
Bastian
--
Fascinating, a totally parochial attitude.
-- Spock, "Metamorphosis", stardate 3219.8
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/4] tools - Remove machine setting from HOSTCFLAGS
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
0 siblings, 2 replies; 12+ messages in thread
From: Keir Fraser @ 2008-01-27 16:50 UTC (permalink / raw)
To: Bastian Blank; +Cc: xen-devel
On 27/1/08 16:46, "Bastian Blank" <bastian@waldi.eu.org> wrote:
> On Sun, Jan 27, 2008 at 04:37:22PM +0000, Keir Fraser wrote:
>> Then you would not have 'uname -m' indicating x86_64 or amd64, and so
>> XEN_COMPILE_ARCH would be x86_32 by default?
>
> No. uname -m == x86_64 and XEN_TARGET_ARCH = x86_64, but the system
> lacks critical parts to execute the x86_64 binaries.
Weird. Well, okay, we can remove the HOSTCFLAGS bits now anyway, since the
mkchecker problem is fixed.
-- Keir
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/4] tools - Remove machine setting from HOSTCFLAGS
2008-01-27 16:50 ` Keir Fraser
@ 2008-01-27 17:07 ` Bastian Blank
2008-01-27 17:12 ` Bastian Blank
1 sibling, 0 replies; 12+ messages in thread
From: Bastian Blank @ 2008-01-27 17:07 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel
On Sun, Jan 27, 2008 at 04:50:29PM +0000, Keir Fraser wrote:
> Weird. Well, okay, we can remove the HOSTCFLAGS bits now anyway, since the
> mkchecker problem is fixed.
Thanks.
Bastian
--
The face of war has never changed. Surely it is more logical to heal
than to kill.
-- Surak of Vulcan, "The Savage Curtain", stardate 5906.5
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/4] tools - Remove machine setting from HOSTCFLAGS
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
1 sibling, 1 reply; 12+ messages in thread
From: Bastian Blank @ 2008-01-27 17:12 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel
Can you please move the remaining files from xen/public/foreign to
tools/include/xen-foreign?
Bastian
--
Madness has no purpose. Or reason. But it may have a goal.
-- Spock, "The Alternative Factor", stardate 3088.7
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/4] tools - Remove machine setting from HOSTCFLAGS
2008-01-27 17:12 ` Bastian Blank
@ 2008-01-27 17:21 ` Keir Fraser
0 siblings, 0 replies; 12+ messages in thread
From: Keir Fraser @ 2008-01-27 17:21 UTC (permalink / raw)
To: Bastian Blank; +Cc: xen-devel
Done.
K.
On 27/1/08 17:12, "Bastian Blank" <bastian@waldi.eu.org> wrote:
> Can you please move the remaining files from xen/public/foreign to
> tools/include/xen-foreign?
>
> Bastian
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2008-01-27 17:21 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
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.