Don't empty CFLAGS in Makefile for static building
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest1 patch 2 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/1 | Makefile: Don't set -CFLAGS := in MakefileMakefile | +0 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH kvmtool 0/1] Don't empty CFLAGS in Makefile for static building
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