From: Richard Palethorpe <rpalethorpe@suse.de>
To: Martin Doucha <mdoucha@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] Add KVM_LD Makefile variable for building KVM payload binaries
Date: Tue, 26 Jul 2022 10:30:50 +0100 [thread overview]
Message-ID: <87h73443tl.fsf@suse.de> (raw)
In-Reply-To: <20220725153727.30418-1-mdoucha@suse.cz>
Hello,
Acked-by: Richard Palethorpe <rpalethorpe@suse.com>
Martin Doucha <mdoucha@suse.cz> writes:
> KVM linker needs to be configurable for cross-compiling but some
> linkers don't support the linker script for wrapping arbitrary files
> into linkable resource files. Allow KVM linker to be changed
> independently of $LD via $KVM_LD.
>
> Signed-off-by: Martin Doucha <mdoucha@suse.cz>
> ---
>
> This should solve the issues with
> https://github.com/linux-test-project/ltp/pull/948
>
> doc/build-system-guide.txt | 5 +++++
> testcases/kernel/kvm/Makefile | 5 +++--
> 2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/doc/build-system-guide.txt b/doc/build-system-guide.txt
> index 166f7fb92..b8d267b4b 100644
> --- a/doc/build-system-guide.txt
> +++ b/doc/build-system-guide.txt
> @@ -145,6 +145,11 @@ $(CPPFLAGS) : Preprocessor flags, e.g. -I arguments.
>
> $(DEBUG_CFLAGS) : Debug flags to pass to $(CC), -g, etc.
>
> +$(KVM_LD) : Special linker for wrapping KVM payload binaries
> + into linkable object files. Defaults to $(LD).
> + Change this variable if the KVM Makefile fails
> + to build files named *-payload.o.
> +
> $(LD) : The system linker (typically $(CC), but not
> necessarily).
>
> diff --git a/testcases/kernel/kvm/Makefile b/testcases/kernel/kvm/Makefile
> index 22a840da6..6986844be 100644
> --- a/testcases/kernel/kvm/Makefile
> +++ b/testcases/kernel/kvm/Makefile
> @@ -11,6 +11,7 @@ GUEST_CPPFLAGS = $(CPPFLAGS) -DCOMPILE_PAYLOAD
> GUEST_CFLAGS = -ffreestanding -O2 -Wall -fno-asynchronous-unwind-tables -mno-mmx -mno-sse
> GUEST_LDFLAGS = -nostdlib -Wl,--build-id=none -fno-stack-protector
> GUEST_LDLIBS =
> +KVM_LD ?= $(LD)
>
> FILTER_OUT_MAKE_TARGETS := lib_guest lib_host lib_x86
>
> @@ -53,11 +54,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) -z noexecstack -r -T $(abs_srcdir)/linker/payload.lds --oformat=$(BIN_FORMAT) -o $@ $*-payload.bin
> + $(KVM_LD) -z noexecstack -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) -z noexecstack -r -T $(abs_srcdir)/linker/payload.lds --oformat=$(BIN_FORMAT) -o $@ $*-payload.bin
> + @$(KVM_LD) -z noexecstack -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.36.1
--
Thank you,
Richard.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2022-07-26 9:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-25 15:37 [LTP] [PATCH] Add KVM_LD Makefile variable for building KVM payload binaries Martin Doucha
2022-07-26 9:30 ` Richard Palethorpe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h73443tl.fsf@suse.de \
--to=rpalethorpe@suse.de \
--cc=ltp@lists.linux.it \
--cc=mdoucha@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox