Partially revert "debian/rules: Combine shared Make args"
authorHans van Kranenburg <hans@knorrie.org>
Sat, 21 Nov 2020 21:52:20 +0000 (22:52 +0100)
committerHans van Kranenburg <hans@knorrie.org>
Sat, 21 Nov 2020 23:04:38 +0000 (00:04 +0100)
This reverts part of commit af30268ed73397d24acaee83477ff555a43df5e4.

The change caused the following FTBFS on i386:

    gcc    -Wl,-z,relro -Wl,-z,now -pthread -Wl,-soname
    -Wl,libxentoolcore.so.1 -shared -Wl,--version-script=libxentoolcore.map
    -o libxentoolcore.so.1.0 handlereg.opic
    /usr/bin/ld: i386:x86-64 architecture of input file `handlereg.opic' is
    incompatible with i386 output
    /usr/bin/ld: handlereg.opic: file class ELFCLASS64 incompatible with
    ELFCLASS32
    /usr/bin/ld: final link failed: file in wrong format
    collect2: error: ld returned 1 exit status

"For $(make_args_xen), ${XEN_TARGET_ARCH} gets $(xen_arch_$(flavour)),
but for $(make_args_tools), ${XEN_TARGET_ARCH} gets
$(xen_arch_$(DEB_HOST_ARCH))."

debian/rules

index 81a0896a76a866459f28a13071d2c326d560f8ed..4032dc9c153d0d0a3dae273e8d06b9a6284e8bef 100755 (executable)
@@ -135,14 +135,15 @@ dpkg_CPPFLAGS := $(shell $(dbmo) dpkg-buildflags --get CPPFLAGS)
 dpkg_LDFLAGS  := $(shell $(dbmo) dpkg-buildflags --get LDFLAGS)
 
 make_args_common := \
-       XEN_COMPILE_ARCH=$(xen_arch_$(DEB_BUILD_ARCH)) \
-       XEN_TARGET_ARCH=$(xen_arch_$(flavour))
+       XEN_COMPILE_ARCH=$(xen_arch_$(DEB_BUILD_ARCH))
 
-make_args_xen := $(make_args_common)
+make_args_xen := $(make_args_common) \
+       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_TARGET_ARCH=$(xen_arch_$(DEB_HOST_ARCH)) \
        EXTRA_CFLAGS_XEN_TOOLS='$(dpkg_CFLAGS) $(dpkg_CPPFLAGS)' \
        PREPEND_LDFLAGS_XEN_TOOLS='$(dpkg_LDFLAGS)'