From: Alexandru Elisei <alexandru.elisei@arm.com>
To: Yao Yuan <yaoyuan@linux.alibaba.com>
Cc: kvm@vger.kernel.org, julien.thierry.kdev@gmail.com,
will@kernel.org, yaoyuan0329os@gmail.com
Subject: Re: [PATCH kvmtool 0/1] Don't empty CFLAGS in Makefile for static building
Date: Mon, 17 Aug 2026 10:43:37 +0100 [thread overview]
Message-ID: <aoLXycEYCnJTjQ-D@raptor> (raw)
In-Reply-To: <20260817084534.92780-1-yaoyuan@linux.alibaba.com>
Hi,
On Mon, Aug 17, 2026 at 04:45:33PM +0800, Yao Yuan wrote:
> Don't set the CFLAGS to empty in Makefile for passing more
> CFLAGS options from environment variable, e.g -static for
> native static building.
I think the lkvm-static makefile target might be your friend in this case :)
$ make -j$(getconf _NPROCESSORS_ONLN) ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- lkvm-static
(have a look at the $(PROGRAM)-static target if you want to double check that it
fits your needs)
Thanks,
Alex
>
> One use case of static buidling is using kvmtool for
> pre-silicon validation on emulation system, such system has
> limited or even no IO part and run w/ small solo ramdisk as
> linux userspace instead of full Linux distribution, and run
> in slow speed. Thus the self-contained kvmtool static
> building is good choice in performance and size for testing
> on such system.
>
> The static building is verified on arm64 host:
>
> CFLAGS=-static make -j32
> ...
> LINK lkvm
> LN vm
>
> $ldd ./lkvm
> not a dynamic executable
>
> The funciton is verified w/ below command, boot arm64 guest
> to serial successfully:
>
> cmdline=(
> ignore_loglevel
> earlycon=uart8250,mmio,0x1000000,115200n8
> console=uart8250,mmio,0x1000000,115200n8
> nokaslr
> selinux=0
> audit=0
> root=/dev/vda3
> )
>
> ./lkvm run \
> --name test_kvmtool \
> -c 4 -m 1G \
> --nodefaults \
> --irqchip gicv3-its \
> --console serial \
> --virtio-transport pci \
> --disk /path/to/the/disk/image
> --kernel /path/to/the/arm64/boot/image
> --param "${cmdline[*]}"
>
>
> Yao Yuan (1):
> Makefile: Don't set -CFLAGS := in Makefile
>
> Makefile | 1 -
> 1 file changed, 1 deletion(-)
>
> --
> 2.43.5
>
next prev parent reply other threads:[~2026-08-17 9:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 8:45 [PATCH kvmtool 0/1] Don't empty CFLAGS in Makefile for static building Yao Yuan
2026-08-17 8:45 ` [PATCH kvmtool 1/1] Makefile: Don't set -CFLAGS := in Makefile Yao Yuan
2026-08-17 9:43 ` Alexandru Elisei [this message]
2026-08-18 0:35 ` [PATCH kvmtool 0/1] Don't empty CFLAGS in Makefile for static building Yao Yuan
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=aoLXycEYCnJTjQ-D@raptor \
--to=alexandru.elisei@arm.com \
--cc=julien.thierry.kdev@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=will@kernel.org \
--cc=yaoyuan0329os@gmail.com \
--cc=yaoyuan@linux.alibaba.com \
/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