]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
ltp: fix builds when host ld doesn't know about target ELF formats
authorRoss Burton <ross.burton@arm.com>
Tue, 12 Jul 2022 14:37:34 +0000 (15:37 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 14 Jul 2022 09:08:37 +0000 (10:08 +0100)
The kvm tests use the host ld, which doesn't necessarily know about the
target ELF format.  It should be using the cross ld we built, so call
$(LD) instead.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
meta/recipes-extended/ltp/ltp/0001-kvm-use-LD-instead-of-hardcoding-ld.patch [new file with mode: 0644]
meta/recipes-extended/ltp/ltp_20220527.bb

diff --git a/meta/recipes-extended/ltp/ltp/0001-kvm-use-LD-instead-of-hardcoding-ld.patch b/meta/recipes-extended/ltp/ltp/0001-kvm-use-LD-instead-of-hardcoding-ld.patch
new file mode 100644 (file)
index 0000000..23634d0
--- /dev/null
@@ -0,0 +1,37 @@
+Upstream-Status: Submitted [https://github.com/linux-test-project/ltp/pull/948]
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+
+From 7670233e43df2aed6d44b96c51b034f8e2d28a19 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@arm.com>
+Date: Tue, 12 Jul 2022 15:03:54 +0100
+Subject: [PATCH] kvm: use $(LD) instead of hardcoding ld
+
+In cross-compiled builds the host ld may not know the required ELF format,
+so ensure we use $(LD) which will be the cross-capable ld binary.
+
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+---
+ testcases/kernel/kvm/Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/testcases/kernel/kvm/Makefile b/testcases/kernel/kvm/Makefile
+index 69a9946fe..4ddef9f95 100644
+--- a/testcases/kernel/kvm/Makefile
++++ b/testcases/kernel/kvm/Makefile
+@@ -50,11 +50,11 @@ include $(top_srcdir)/include/mk/generic_leaf_target.mk
+ ifdef VERBOSE
+       $(CC) $(GUEST_CPPFLAGS) $(GUEST_CFLAGS) $(GUEST_LDFLAGS) -o $*-payload.elf $^ $(GUEST_LDLIBS)
+       objcopy -O binary -j .init.boot -j .text -j .data -j .init -j .preinit_array -j .init_array --gap-fill=0 $*-payload.elf $*-payload.bin
+-      ld -r -T $(abs_srcdir)/linker/payload.lds --oformat=$(BIN_FORMAT) -o $@ $*-payload.bin
++      $(LD) -r -T $(abs_srcdir)/linker/payload.lds --oformat=$(BIN_FORMAT) -o $@ $*-payload.bin
+ else
+       @$(CC) $(GUEST_CPPFLAGS) $(GUEST_CFLAGS) $(GUEST_LDFLAGS) -o $*-payload.elf $^ $(GUEST_LDLIBS)
+       @objcopy -O binary -j .init.boot -j .text -j .data -j .init -j .preinit_array -j .init_array --gap-fill=0 $*-payload.elf $*-payload.bin
+-      @ld -r -T $(abs_srcdir)/linker/payload.lds --oformat=$(BIN_FORMAT) -o $@ $*-payload.bin
++      @$(LD) -r -T $(abs_srcdir)/linker/payload.lds --oformat=$(BIN_FORMAT) -o $@ $*-payload.bin
+       @echo KVM_CC $(target_rel_dir)$@
+ endif
+       @rm $*-payload.elf $*-payload.bin
+-- 
+2.34.1
+
index 56fa83f5a03555d8201867190b3254c98eca4d49..094251ec811f7f6e29df356f7f93e9adca40d96a 100644 (file)
@@ -28,6 +28,7 @@ SRCREV = "6f88e0f6f1d6eb12c48c902f50f47ecbd3b0f18a"
 SRC_URI = "git://github.com/linux-test-project/ltp.git;branch=master;protocol=https \
            file://0001-Remove-OOM-tests-from-runtest-mm.patch \
            file://disable_hanging_tests.patch \
+           file://0001-kvm-use-LD-instead-of-hardcoding-ld.patch \
            "
 
 S = "${WORKDIR}/git"