Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame^] | 1 | Upstream-Status: Submitted [https://github.com/linux-test-project/ltp/pull/948] |
| 2 | Signed-off-by: Ross Burton <ross.burton@arm.com> |
| 3 | |
| 4 | From 7670233e43df2aed6d44b96c51b034f8e2d28a19 Mon Sep 17 00:00:00 2001 |
| 5 | From: Ross Burton <ross.burton@arm.com> |
| 6 | Date: Tue, 12 Jul 2022 15:03:54 +0100 |
| 7 | Subject: [PATCH] kvm: use $(LD) instead of hardcoding ld |
| 8 | |
| 9 | In cross-compiled builds the host ld may not know the required ELF format, |
| 10 | so ensure we use $(LD) which will be the cross-capable ld binary. |
| 11 | |
| 12 | Signed-off-by: Ross Burton <ross.burton@arm.com> |
| 13 | --- |
| 14 | testcases/kernel/kvm/Makefile | 4 ++-- |
| 15 | 1 file changed, 2 insertions(+), 2 deletions(-) |
| 16 | |
| 17 | diff --git a/testcases/kernel/kvm/Makefile b/testcases/kernel/kvm/Makefile |
| 18 | index 69a9946fe..4ddef9f95 100644 |
| 19 | --- a/testcases/kernel/kvm/Makefile |
| 20 | +++ b/testcases/kernel/kvm/Makefile |
| 21 | @@ -50,11 +50,11 @@ include $(top_srcdir)/include/mk/generic_leaf_target.mk |
| 22 | ifdef VERBOSE |
| 23 | $(CC) $(GUEST_CPPFLAGS) $(GUEST_CFLAGS) $(GUEST_LDFLAGS) -o $*-payload.elf $^ $(GUEST_LDLIBS) |
| 24 | 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 |
| 25 | - ld -r -T $(abs_srcdir)/linker/payload.lds --oformat=$(BIN_FORMAT) -o $@ $*-payload.bin |
| 26 | + $(LD) -r -T $(abs_srcdir)/linker/payload.lds --oformat=$(BIN_FORMAT) -o $@ $*-payload.bin |
| 27 | else |
| 28 | @$(CC) $(GUEST_CPPFLAGS) $(GUEST_CFLAGS) $(GUEST_LDFLAGS) -o $*-payload.elf $^ $(GUEST_LDLIBS) |
| 29 | @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 |
| 30 | - @ld -r -T $(abs_srcdir)/linker/payload.lds --oformat=$(BIN_FORMAT) -o $@ $*-payload.bin |
| 31 | + @$(LD) -r -T $(abs_srcdir)/linker/payload.lds --oformat=$(BIN_FORMAT) -o $@ $*-payload.bin |
| 32 | @echo KVM_CC $(target_rel_dir)$@ |
| 33 | endif |
| 34 | @rm $*-payload.elf $*-payload.bin |
| 35 | -- |
| 36 | 2.34.1 |
| 37 | |