debian/rules: Fix some cases of HOST/BUILD arch confusion
authorIan Jackson <iwj@barriere.debian.org>
Fri, 12 Oct 2018 16:07:05 +0000 (16:07 +0000)
committerHans van Kranenburg <hans@knorrie.org>
Wed, 2 Jan 2019 19:59:36 +0000 (20:59 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/rules

index e1a07a9ccdc5ea07664d66519457d84e5706979a..af5d692eafa15eb011ce5a2b00e1bc11a4c45cc5 100755 (executable)
@@ -26,6 +26,13 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 # 64-bit hypervisor even on i386 (since there is no 32-bit hypervisor
 # anymore).
 
+# Also there is terminological confusion.  The DEB_* variables follow
+# GNU GCC terminology:
+#
+# dpkg / GNU    Xen         Meaning
+#  BUILD         COMPILE     Host: where this build is running
+#  HOST          TARGET      Target: where the binaries we build now will run
+
 include /usr/share/dpkg/architecture.mk
 
 # Xen has its own different architecture names, which are nither
@@ -41,7 +48,7 @@ xen_arch_i386  = x86_32
 xen_arch_armhf = arm32
 xen_arch_arm64 = arm64
 
-flavour=$(flavour_$(DEB_BUILD_ARCH))
+flavour=$(flavour_$(DEB_HOST_ARCH))
 
 # Much of the work here is to make different upstream versions of Xen
 # coinstallable, and arrange to run which ever version of the tools
@@ -125,14 +132,14 @@ dpkg_CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
 dpkg_LDFLAGS  := $(shell dpkg-buildflags --get LDFLAGS)
 
 make_args_xen= $(make_args_common) \
-       XEN_COMPILE_ARCH=$(xen_arch_$(flavour)) \
+       XEN_COMPILE_ARCH=$(xen_arch_$(DEB_BUILD_ARCH)) \
        XEN_TARGET_ARCH=$(xen_arch_$(flavour)) \
 # (Xen upstream does not offer a separate CPPFLAGS,
 # so we pass those in CFLAGS.)
 
 make_args_tools= $(make_args_common) \
        XEN_COMPILE_ARCH=$(xen_arch_$(DEB_BUILD_ARCH)) \
-       XEN_TARGET_ARCH=$(xen_arch_$(DEB_BUILD_ARCH)) \
+       XEN_TARGET_ARCH=$(xen_arch_$(DEB_HOST_ARCH)) \
        EXTRA_CFLAGS_XEN_TOOLS='$(dpkg_CFLAGS) $(dpkg_CPPFLAGS)' \
        PREPEND_LDFLAGS_XEN_TOOLS='$(dpkg_LDFLAGS)'