]> xenbits.xensource.com Git - people/andrewcoop/xen-test-framework.git/commitdiff
don't require x32 support in binutils
authorJan Beulich <jbeulich@suse.com>
Wed, 14 Dec 2016 13:31:25 +0000 (13:31 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 14 Dec 2016 13:31:25 +0000 (13:31 +0000)
Older binutils don't have this at all, and newer may not have it
configured in.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
build/gen.mk

index 55fc39d009bea783834ceab2085a78631818e342..5cc2c90c1fb51b4e752d29795ad79bb459a309d1 100644 (file)
@@ -40,6 +40,8 @@ install: install-each-env info.json
        @$(INSTALL_DIR) $(DESTDIR)$(xtftestdir)/$(NAME)
        $(INSTALL_DATA) info.json $(DESTDIR)$(xtftestdir)/$(NAME)
 
+hvm64-format := $(firstword $(filter elf32-x86-64,$(shell $(OBJCOPY) --help)) elf32-i386)
+
 define PERENV_build
 
 ifneq ($(1),hvm64)
@@ -47,10 +49,10 @@ ifneq ($(1),hvm64)
 test-$(1)-$(NAME): $$(DEPS-$(1)) $$(link-$(1))
        $$(LD) $$(LDFLAGS_$(1)) $$(DEPS-$(1)) -o $$@
 else
-# hvm64 needs linking normally, then converting to elf32-x86-64
+# hvm64 needs linking normally, then converting to elf32-x86-64 or elf32-i386
 test-$(1)-$(NAME): $$(DEPS-$(1)) $$(link-$(1))
        $$(LD) $$(LDFLAGS_$(1)) $$(DEPS-$(1)) -o $$@.tmp
-       $$(OBJCOPY) $$@.tmp -O elf32-x86-64 $$@
+       $(OBJCOPY) $$@.tmp -O $(hvm64-format) $$@
        rm -f $$@.tmp
 endif