Kernel KVM virtualization development
 help / color / mirror / Atom feed
* [PATCH kvmtool 0/1] Don't empty CFLAGS in Makefile for static building
@ 2026-08-17  8:45 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 ` [PATCH kvmtool 0/1] Don't empty CFLAGS in Makefile for static building Alexandru Elisei
  0 siblings, 2 replies; 4+ messages in thread
From: Yao Yuan @ 2026-08-17  8:45 UTC (permalink / raw)
  To: kvm, julien.thierry.kdev, will; +Cc: yaoyuan0329os, yaoyuan

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-18  0:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH kvmtool 0/1] Don't empty CFLAGS in Makefile for static building Alexandru Elisei
2026-08-18  0:35   ` Yao Yuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox