Aron Griffis
2008-Jul-31 14:51 UTC
[Xen-ia64-devel] [PATCH 0 of 2] partly fix cross-build of ioemu-remote
These two patches partly repair cross-building of ioemu-dir. There''s still a problem where the translation layer is being built, which doesn''t exist for ia64, so it bombs out eventually. The first patch applies to xen-unstable.hg, second patch applies to the ioemu git tree. Thanks, Aron _______________________________________________ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
Aron Griffis
2008-Jul-31 14:51 UTC
[Xen-devel] [PATCH 1 of 2] pass IOEMU_CONFIGURE_CROSS to ioemu-remote/xen-setup
# HG changeset patch # User Aron Griffis <aron@hp.com> # Date 1217515818 14400 # Node ID be6b349abfb8d1d84618597c5304ab2e0500d5b4 # Parent 05391ca07588c45f5c8dd16c2a470b0d615767b8 pass IOEMU_CONFIGURE_CROSS to ioemu-remote/xen-setup Add --cpu to IOEMU_CONFIGURE_CROSS since otherwise qemu uses the output of `uname -m` even for cross-building. Pass IOEMU_CONFIGURE_CROSS to xen-setup which passes it on to ioemu/configure. Signed-off-by: Aron Griffis <aron@hp.com> diff -r 05391ca07588 -r be6b349abfb8 tools/Makefile --- a/tools/Makefile Thu Jul 31 11:14:23 2008 +0100 +++ b/tools/Makefile Thu Jul 31 10:50:18 2008 -0400 @@ -55,7 +55,8 @@ clean distclean: subdirs-clean ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH)) -IOEMU_CONFIGURE_CROSS ?= --cross-prefix=$(CROSS_COMPILE) \ +IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \ + --cross-prefix=$(CROSS_COMPILE) \ --interp-prefix=$(CROSS_SYS_ROOT) endif @@ -96,7 +97,7 @@ esac; \ export XEN_ROOT; \ cd ioemu-dir; \ - ./xen-setup + ./xen-setup $(IOEMU_CONFIGURE_CROSS) subdir-all-ioemu-dir subdir-install-ioemu-dir: ioemu-dir-find _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Aron Griffis
2008-Jul-31 14:51 UTC
[Xen-ia64-devel] [PATCH 2 of 2] cross-build fixes in ioemu-remote
Partly fix cross-building in ioemu-remote: - Don''t call install -s; it uses the host strip program which doesn''t understand cross-built binaries. This same change was in the legacy ioemu dir. - The ioemu version of cc-option doesn''t take $(CC) as the first argument, so all builds were getting -msse2 regardless of architecture. Signed-off-by: Aron Griffis <aron@hp.com> diff --git a/Makefile b/Makefile index bebd244..b055b3f 100644 --- a/Makefile +++ b/Makefile @@ -205,7 +205,7 @@ endif install: all $(if $(BUILD_DOCS),install-doc) mkdir -p "$(DESTDIR)$(bindir)" ifneq ($(TOOLS),) - $(INSTALL) -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)" + $(INSTALL) -m 755 $(TOOLS) "$(DESTDIR)$(bindir)" endif mkdir -p "$(DESTDIR)$(datadir)" set -e; for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \ diff --git a/Makefile.target b/Makefile.target index 1aace9c..e796d61 100644 --- a/Makefile.target +++ b/Makefile.target @@ -707,7 +707,7 @@ clean: install: all install-hook ifneq ($(PROGS),) - $(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)" + $(INSTALL) -m 755 $(PROGS) "$(DESTDIR)$(bindir)" endif # Include automatically generated dependency files diff --git a/xen-hooks.mak b/xen-hooks.mak index af977ef..c90f546 100644 --- a/xen-hooks.mak +++ b/xen-hooks.mak @@ -3,7 +3,7 @@ CPPFLAGS+= -I$(XEN_ROOT)/tools/xenstore CPPFLAGS+= -I$(XEN_ROOT)/tools/include CPPFLAGS+= -I$(XEN_ROOT)/tools/blktap/lib -SSE2 := $(call cc-option,$(CC),-msse2,) +SSE2 := $(call cc-option,-msse2,) ifeq ($(SSE2),-msse2) CFLAGS += -DUSE_SSE2=1 -msse2 endif _______________________________________________ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
Ian Jackson
2008-Jul-31 15:16 UTC
[Xen-ia64-devel] Re: [Xen-devel] [PATCH 2 of 2] cross-build fixes in ioemu-remote
Aron Griffis writes ("[Xen-devel] [PATCH 2 of 2] cross-build fixes in ioemu-remote"):> Partly fix cross-building in ioemu-remote: > > - The ioemu version of cc-option doesn''t take $(CC) as the first > argument, so all builds were getting -msse2 regardless of > architecture.I''ll commit this in just a moment.> - Don''t call install -s; it uses the host strip program which > doesn''t understand cross-built binaries. This same change was > in the legacy ioemu dir.I think this should be fixed by the build environment, or possibly $(INSTALL), being arranged to not have this bug. If $(INSTALL) -s doesn''t work then this should be fixed. Options include putting a symlink to /bin/true on the path somewhere under the name `strip'', or overriding INSTALL somehow to a more clever program. I really don''t want to apply these Makefile changes. That is the kind of thing which makes merging painful. Ian. _______________________________________________ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
Samuel Thibault
2008-Jul-31 15:29 UTC
Re: [Xen-ia64-devel] Re: [Xen-devel] [PATCH 2 of 2] cross-build fixes in ioemu-remote
Ian Jackson, le Thu 31 Jul 2008 16:16:37 +0100, a écrit :> Aron Griffis writes ("[Xen-devel] [PATCH 2 of 2] cross-build fixes in ioemu-remote"): > > - Don''t call install -s; it uses the host strip program which > > doesn''t understand cross-built binaries. This same change was > > in the legacy ioemu dir. > > I think this should be fixed by the build environment, or possibly > $(INSTALL), being arranged to not have this bug. If $(INSTALL) -s > doesn''t work then this should be fixed. Options include putting a > symlink to /bin/true on the path somewhere under the name `strip'', or > overriding INSTALL somehow to a more clever program.I have the same issue when cross-compiling some other projects. I wonder how install would be able to know which strip command it should use. Samuel _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Samuel Thibault
2008-Jul-31 15:34 UTC
Re: [Xen-ia64-devel] Re: [Xen-devel] [PATCH 2 of 2] cross-build fixes in ioemu-remote
Ian Jackson, le Thu 31 Jul 2008 16:16:37 +0100, a écrit :> Aron Griffis writes ("[Xen-devel] [PATCH 2 of 2] cross-build fixes in ioemu-remote"): > > Partly fix cross-building in ioemu-remote: > > > > - The ioemu version of cc-option doesn''t take $(CC) as the first > > argument, so all builds were getting -msse2 regardless of > > architecture. > > I''ll commit this in just a moment.Mmm, actually I think we don''t need that sse2 option any more: thanks to dirty bit tracking, the sse2-optimized memcmp loop is gone. At least -DUSE_SSE2 is not used anywhere. Samuel _______________________________________________ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
Ian Jackson
2008-Jul-31 16:48 UTC
Re: [Xen-ia64-devel] Re: [Xen-devel] [PATCH 2 of 2] cross-build fixes in ioemu-remote
Samuel Thibault writes ("Re: [Xen-ia64-devel] Re: [Xen-devel] [PATCH 2 of 2] cross-build fixes in ioemu-remote"):> I have the same issue when cross-compiling some other projects. I > wonder how install would be able to know which strip command it should > use.Perhaps it should call STRIP if it exists, or perhaps the cross-building setup should provide a `strip'' which will always DTRT (perhaps by examining the file to decide which real strip to invoke). Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Aron Griffis
2008-Jul-31 19:21 UTC
Re: [Xen-ia64-devel] Re: [Xen-devel] [PATCH 2 of 2] cross-build fixes in ioemu-remote
Ian Jackson wrote: [Thu Jul 31 2008, 12:48:15PM EDT]> Samuel Thibault writes ("Re: [Xen-ia64-devel] Re: [Xen-devel] [PATCH 2 of 2] cross-build fixes in ioemu-remote"): > > I have the same issue when cross-compiling some other projects. I > > wonder how install would be able to know which strip command it should > > use. > > Perhaps it should call STRIP if it exists, or perhaps the > cross-building setup should provide a `strip'' which will always DTRT > (perhaps by examining the file to decide which real strip to invoke).I don''t think it''s necessary to provide one that will DTRT. The compiler and linker don''t need that abstraction, and "install" is only called for stuff that will be installed on the target system. qemu seems to have the ability to set the install command using configure. Seems something like the following should work, except that (1) i386-dm/hookstarget.mak uses $(INSTALL_PROG) which seems to be defined outside of the ioemu tree, and (2) I''m having enough trouble cross-building qemu that it''s hard to test. Thanks, Aron diff -r 40daf3257cad tools/Makefile --- a/tools/Makefile Thu Jul 31 10:51:30 2008 -0400 +++ b/tools/Makefile Thu Jul 31 15:18:24 2008 -0400 @@ -36,9 +36,11 @@ SUBDIRS-$(PYTHON_TOOLS) += pygrub SUBDIRS-$(PYTHON_TOOLS) += pygrub endif -# For the sake of linking, set the sys-root +# For the sake of linking, set the path to "strip" and the sys-root ifneq ($(CROSS_COMPILE),) +CROSS_BIN_PATH ?= /usr/$(CROSS_COMPILE:-=)/bin CROSS_SYS_ROOT ?= /usr/$(CROSS_COMPILE:-=)/sys-root +# export sys-root to environment for check/funcs.sh export CROSS_SYS_ROOT endif @@ -57,7 +59,8 @@ ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH)) IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \ --cross-prefix=$(CROSS_COMPILE) \ - --interp-prefix=$(CROSS_SYS_ROOT) + --interp-prefix=$(CROSS_SYS_ROOT) \ + --install=''env PATH="$(CROSS_BIN_PATH):$$$$PATH" install'' endif ioemu/config-host.mak: _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2008-Aug-01 16:26 UTC
Re: [Xen-ia64-devel] Re: [Xen-devel] [PATCH 2 of 2] cross-build fixes in ioemu-remote
Aron Griffis writes ("Re: [Xen-ia64-devel] Re: [Xen-devel] [PATCH 2 of 2] cross-build fixes in ioemu-remote"):> - --interp-prefix=$(CROSS_SYS_ROOT) > + --interp-prefix=$(CROSS_SYS_ROOT) \ > + --install=''env PATH="$(CROSS_BIN_PATH):$$$$PATH" install''This is a bit bizarre (not to mention the fact that the number of $''s will depend on undocumented properties of the way qemu''s configure inteprets that option). Why not just set PATH directly and export it ? But in general I think this is a reasonable approach. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Aron Griffis
2008-Aug-01 17:22 UTC
Re: [Xen-ia64-devel] Re: [Xen-devel] [PATCH 2 of 2] cross-build fixes in ioemu-remote
Ian Jackson wrote: [Fri Aug 01 2008, 12:26:54PM EDT]> Aron Griffis writes ("Re: [Xen-ia64-devel] Re: [Xen-devel] [PATCH 2 of 2] cross-build fixes in ioemu-remote"): > > - --interp-prefix=$(CROSS_SYS_ROOT) > > + --interp-prefix=$(CROSS_SYS_ROOT) \ > > + --install=''env PATH="$(CROSS_BIN_PATH):$$$$PATH" install'' > > This is a bit bizarre (not to mention the fact that the number > of $''s will depend on undocumented properties of the way qemu''s > configure inteprets that option).qemu''s configure uses quoting properly and applies no interpretation on the way through. The dollars are doubled once for the Makefile where this is set, once for the inner Makefile where it is used. However... there is a Solaris hack in configure that will break with any --install option other than a bare word. And I agree with you anyway, it''s a fragile approach.> Why not just set PATH directly and export it ?qemu expects "gcc" and the like to refer to the host toolchain. I think we only want the PATH set for install. Ideally there would be an /usr/bin/ia64-linux-gnu-install to accompany the others and use the right strip, but oh well.> But in general I think this is a reasonable approach.How about... # HG changeset patch # User Aron Griffis <aron@hp.com> # Date 1217610812 14400 # Node ID 714215c06a98ea845e3f25371945d62abb1c18c7 # Parent f69a23b209c4ab04827051734e37f095607400ed add cross-install to find the right "strip" Signed-off-by: Aron Griffis <aron@hp.com> diff --git a/tools/Makefile b/tools/Makefile --- a/tools/Makefile +++ b/tools/Makefile @@ -38,8 +38,10 @@ # For the sake of linking, set the sys-root ifneq ($(CROSS_COMPILE),) +CROSS_BIN_PATH ?= /usr/$(CROSS_COMPILE:-=)/bin CROSS_SYS_ROOT ?= /usr/$(CROSS_COMPILE:-=)/sys-root -export CROSS_SYS_ROOT +export CROSS_SYS_ROOT # exported for check/funcs.sh +export CROSS_BIN_PATH # exported for cross-install.sh endif .PHONY: all @@ -57,7 +59,8 @@ ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH)) IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \ --cross-prefix=$(CROSS_COMPILE) \ - --interp-prefix=$(CROSS_SYS_ROOT) + --interp-prefix=$(CROSS_SYS_ROOT) \ + --install=$(CURDIR)/cross-install endif ioemu/config-host.mak: diff --git a/tools/cross-install b/tools/cross-install new file mode 100755 --- /dev/null +++ b/tools/cross-install @@ -0,0 +1,8 @@ +#!/bin/sh + +# prepend CROSS_BIN_PATH to find the right "strip" +if [ -n "$CROSS_BIN_PATH" ]; then + PATH="$CROSS_BIN_PATH:$PATH" +fi + +exec install "$@" _______________________________________________ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
Aron Griffis
2008-Aug-04 22:31 UTC
Re: [Xen-ia64-devel] Re: [Xen-devel] [PATCH 2 of 2] cross-build fixes in ioemu-remote
Any responses to my last email and patch in this thread? It would be nice to get cross-install (or something like it) in the tree, along with fixing the build on ia64. The build problem is that translate-all.c doesn''t build on ia64, because there''s no support for instruction translation on ia64. But it shouldn''t need to build translate-all.c at all for ioemu. It didn''t on the legacy ioemu, and it''s only working right now on ia32 and x86_64 because those arches can build translate-all.c, however unnecessary it is. I took a quick look but I''m not quickly seeing how to change the build to omit translate-all.c. It would be great if somebody more familiar with ioemu could take a glance. Thanks, Aron _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2008-Aug-05 07:40 UTC
Re: [Xen-ia64-devel] Re: [Xen-devel] [PATCH 2 of 2] cross-build fixes in ioemu-remote
Unfortunately Ian is away this week, so these changes aren''t likely to get picked up or commented on until Monday. -- Keir On 4/8/08 23:31, "Aron Griffis" <aron@hp.com> wrote:> Any responses to my last email and patch in this thread? > > It would be nice to get cross-install (or something like it) in > the tree, along with fixing the build on ia64. > > The build problem is that translate-all.c doesn''t build on ia64, > because there''s no support for instruction translation on ia64. > But it shouldn''t need to build translate-all.c at all for ioemu. > It didn''t on the legacy ioemu, and it''s only working right now on > ia32 and x86_64 because those arches can build translate-all.c, > however unnecessary it is. > > I took a quick look but I''m not quickly seeing how to change the > build to omit translate-all.c. It would be great if somebody > more familiar with ioemu could take a glance. > > Thanks, > Aron > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2008-Aug-11 09:15 UTC
Re: [Xen-ia64-devel] Re: [Xen-devel] [PATCH 2 of 2] cross-build fixes in ioemu-remote
Aron Griffis writes ("Re: [Xen-ia64-devel] Re: [Xen-devel] [PATCH 2 of 2] cross-build fixes in ioemu-remote"):> # HG changeset patch > # User Aron Griffis <aron@hp.com> > # Date 1217610812 14400 > # Node ID 714215c06a98ea845e3f25371945d62abb1c18c7 > # Parent f69a23b209c4ab04827051734e37f095607400ed > add cross-install to find the right "strip"I think this is a good patch. Ian. _______________________________________________ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel