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

[Xen-devel] [OSSTEST PATCH 14/26] rumprun: ts-rumprun-build: Update for newer Xen

Newer Xen needs more work to make it cross compile for rump.

* Pass --host=TARGET to configure.  This is needed so that configure
  knows that we are deliberately cross compiling.  (Otherwise it
  tries to run target binaries on the host, and crashes when that fails.)

* Pass CROSS_COMPILE in the environment.  This arranges for the Xen
  Makefiles to run the right compiler, ie $(CROSS_COMPILE)-gcc.

* Put the rump compiler directory on PATH, so that the Xen Makefiles
  can find it.

* Pass HOSTCC=gcc in the environment; otherwise it tries to use the
  default CC (which is $(CROSS_COMPILE)gcc), when building
  build-system-internal tools which are to be run on the host as part
  of the build.

  The need for this could be avoided by setting XEN_TARGET_ARCH to the
  rump architecture, but then we would have to provide a Xen arch
  config file for that architecture, which would be meaningless since
  we are not actually building a hypervisor, and would have to contain
  various dummy information.

NB in this commit message I use Xen terminology for cross arch names:

 Xen          GCC/GNU        Meaning                   Example for
 terminology  terminology                              rump cross build

 host         build          Native architecture of     i586-linux-gnu
                             the environment in which
                             we are running the build.

 target       host           Foreign architecture on    i486-rumprun-netbsdelf
                             which the objects etc.
                             which we are now building
                             will eventually be run.

 n/a          target         Used only when building a "Canadian"
                             cross compiler: the 2nd foreign
                             architecture for which the compiler which
                             we are now building (on the `build(gnu)'
                             arch) will, when we run it, produce
                             binaries (when it is run on the
                             `host(gnu)' arch).

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
 ts-rumprun-build | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/ts-rumprun-build b/ts-rumprun-build
index 7184f9d..98c8efc 100755
--- a/ts-rumprun-build
+++ b/ts-rumprun-build
@@ -55,10 +55,17 @@ END
 sub recordtools() {
     my $gcc = target_cmd_output($ho, "echo $rux/rumprun/bin/*-gcc");
     chomp $gcc;
-    die "$gcc ?" if $gcc =~ m/\S/;
-    my $prefix = "CC=$gcc ";
+    die "$gcc ?" unless $gcc =~ m#^(\S+)/([^/ \t]+)-g?cc$#;
+    my $bindir = $1;
+    my $gnutriplet = $2;
+    my $prefix = "PATH=$bindir:\$PATH ";
+    $prefix .= "CROSS_COMPILE=$gnutriplet- HOSTCC=gcc ";
     store_runvar('cmdprefix_configure', $prefix);
     store_runvar('cmdprefix_make',      $prefix);
+    store_runvar('cmdsuffix_configure', " --host=$gnutriplet");
+    # "host" is daft GCC/GNU terminology for the target architecture of
+    # a cross-compile, ie in our case the rump environemnt architecture
+    # for which the rump compilers are going to generate code.
 sub install() {

Xen-devel mailing list



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