]> xenbits.xensource.com Git - xen.git/commitdiff
tools/configure: Honour XEN_COMPILE_ARCH and _TARGET_ for shim
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 29 Oct 2019 17:45:30 +0000 (17:45 +0000)
committerWei Liu <wl@xen.org>
Wed, 20 Nov 2019 10:11:16 +0000 (10:11 +0000)
The pvshim can only be built 64-bit because the hypervisor is only
64-bit nowadays.  The hypervisor build supports XEN_COMPILE_ARCH and
XEN_TARGET_ARCH which override the information from uname.  The pvshim
build runs out of the tools/ directory but calls the hypervisor build
system.

If one runs in a Linux 32-bit userland with a 64-bit kernel, one used
to be able to set XEN_COMPILE_ARCH.  But nowadays this does not work.
configure sees the target cpu as 64-bit and tries to build pvshim.
The build prints
  echo "*** Xen x86/32 target no longer supported!"
and doesn't build anything.  Then the subsequent Makefiles try to
install the non-built pieces.

Fix this anomaly by causing configure to honour the Xen hypervisor way
of setting the target architecture.

In principle this user behaviour is not handled quite right, because
configure will still see 64-bit and so all the autoconf-based
architecture testing will see 64-bit rather than 32-bit x86.  But the
tools are in fact generally quite portable: this particular location
in configure{.ac,} is the only place in tools/ where 64-bit x86 is
treated differently from 32-bit x86, so the fix is sufficient and
correct for this use case.

It remains the case that XEN_COMPILE_ARCH or XEN_TARGET_ARCH to a
non-x86 architecture, when configure thinks things are x86, or vice
versa, will not work right.

(This is a bugfix to 8845155c831c
  pvshim: make PV shim build selectable from configure
which inadvertantly deleted the logic to only build the shim for
XEN_TARGET_ARCH != x86_32.)

I have rerun autogen.sh, so this patch contains the fix to configure
as well as the source fix to configure.ac.

Fixes: 8845155c831c59e867ee3dd31ee63e0cc6c7dcf2
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
CC: Olaf Hering <olaf@aepfle.de>
CC: Roger Pau Monné <roger.pau@citrix.com>
Release-acked-by: Jürgen Groß <jgross@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Wei Liu <wl@xen.org>
tools/configure
tools/configure.ac

index 82947ad30834e3fc39c4bcd3138b039c4f745389..d9ccce6d2b887e97d1fcc032343e6a5167040896 100755 (executable)
@@ -9711,7 +9711,7 @@ fi
 else
 
     cpu=`test -z "$target_cpu" && echo "$host_cpu" || echo "$target_cpu"`
-    case "$cpu" in
+    case "${XEN_COMPILE_ARCH-${XEN_TARGET_ARCH-$cpu}}" in
         x86_64)
            pvshim="y";;
         *) pvshim="n";;
index 674bd5809debc1a28acc95c258babca721cf32af..a8d8ce5ffe77001b48efa93db982e8add8853d6e 100644 (file)
@@ -479,7 +479,7 @@ AC_ARG_ENABLE([pvshim],
                    [Disable pvshim build (enabled by default on 64bit x86)]),
     [AS_IF([test "x$enable_pvshim" = "xno"], [pvshim=n], [pvshim=y])], [
     cpu=`test -z "$target_cpu" && echo "$host_cpu" || echo "$target_cpu"`
-    case "$cpu" in
+    case "${XEN_COMPILE_ARCH-${XEN_TARGET_ARCH-$cpu}}" in
         x86_64)
            pvshim="y";;
         *) pvshim="n";;