Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Yao Yuan <yaoyuan@linux.alibaba.com>
To: kvm@vger.kernel.org, julien.thierry.kdev@gmail.com, will@kernel.org
Cc: yaoyuan0329os@gmail.com, yaoyuan@linux.alibaba.com
Subject: [PATCH kvmtool 0/1] Don't empty CFLAGS in Makefile for static building
Date: Mon, 17 Aug 2026 16:45:33 +0800	[thread overview]
Message-ID: <20260817084534.92780-1-yaoyuan@linux.alibaba.com> (raw)

Don't set the CFLAGS to empty in Makefile for passing more
CFLAGS options from environment variable, e.g -static for
native static building.

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

             reply	other threads:[~2026-08-17  8:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17  8:45 Yao Yuan [this message]
2026-08-17  8:45 ` [PATCH kvmtool 1/1] Makefile: Don't set -CFLAGS := in Makefile Yao Yuan
2026-08-17  9:43 ` [PATCH kvmtool 0/1] Don't empty CFLAGS in Makefile for static building Alexandru Elisei
2026-08-18  0:35   ` 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=20260817084534.92780-1-yaoyuan@linux.alibaba.com \
    --to=yaoyuan@linux.alibaba.com \
    --cc=julien.thierry.kdev@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=will@kernel.org \
    --cc=yaoyuan0329os@gmail.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