Skip to content

Incomplete description of building examples #895

Open

Description

@xypron

On Ubuntu 26.04 amd64 I tried to follow the README but BLK=1 NET=1 seems to be insufficient:

libkrun$ make BLK=1 NET=1
libkrun$ sudo make BLK=1 NET=1 install
libkrun$ cd examples
libkrun/examples$ make
gcc -o boot_efi boot_efi.c -O2 -g -I../include -lkrun -lkrun_init
/usr/bin/x86_64-linux-gnu-ld.bfd: /tmp/ccMXKDu8.o: in function `listen_shutdown_request':
libkrun/examples/boot_efi.c:172:(.text+0x12a): undefined reference to `krun_vmm_handle_shutdown'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:175:(.text+0x159): undefined reference to `krun_error_destroy'
/usr/bin/x86_64-linux-gnu-ld.bfd: /tmp/ccMXKDu8.o: in function `main':
libkrun/examples/boot_efi.c:200:(.text.startup+0x5a): undefined reference to `krun_init_log'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:203:(.text.startup+0x6b): undefined reference to `krun_mmio_device_manager_new'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:207:(.text.startup+0x73): undefined reference to `krun_console_device_builder'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:208:(.text.startup+0x95): undefined reference to `krun_console_builder_add_default_console'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:209:(.text.startup+0xac): undefined reference to `krun_console_builder_build'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:210:(.text.startup+0xb7): undefined reference to `krun_mmio_device_manager_add'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:214:(.text.startup+0xec): undefined reference to `krun_payload_load_firmware'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:217:(.text.startup+0x12e): undefined reference to `krun_block_device_new'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:219:(.text.startup+0x150): undefined reference to `krun_mmio_device_manager_add'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:224:(.text.startup+0x1af): undefined reference to `krun_net_device_new_unixgram_path'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:227:(.text.startup+0x1ca): undefined reference to `krun_mmio_device_manager_add'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:231:(.text.startup+0x1d9): undefined reference to `krun_rng_device_new'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:232:(.text.startup+0x1f0): undefined reference to `krun_mmio_device_manager_add'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:234:(.text.startup+0x1ff): undefined reference to `krun_balloon_device_new'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:235:(.text.startup+0x216): undefined reference to `krun_mmio_device_manager_add'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:239:(.text.startup+0x21b): undefined reference to `krun_vmm_builder_new'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:240:(.text.startup+0x239): undefined reference to `krun_vmm_builder_vcpus'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:241:(.text.startup+0x257): undefined reference to `krun_vmm_builder_ram_mib'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:242:(.text.startup+0x270): undefined reference to `krun_vmm_builder_payload'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:243:(.text.startup+0x27d): undefined reference to `krun_vmm_builder_devices'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:245:(.text.startup+0x291): undefined reference to `krun_vmm_builder_build'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:248:(.text.startup+0x2ab): undefined reference to `krun_vmm_handle'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:254:(.text.startup+0x2d5): undefined reference to `krun_vmm_run'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:200:(.text.startup+0x36a): undefined reference to `krun_error_message'
/usr/bin/x86_64-linux-gnu-ld.bfd: libkrun/examples/boot_efi.c:200:(.text.startup+0x391): undefined reference to `krun_error_destroy'
collect2: error: ld returned 1 exit status
make: *** [Makefile:41: boot_efi] Error 1

Building libkrun as follows avoided the build error:

make FEATURE_FLAGS="--features ffi,blk,net,vhost-user"

Activity

  1. slp commented on Oct 9, 2026

    @slp
    Collaborator

    @mtjhrc PTAL

  2. mz-pdm commented on Oct 14, 2026

    @mz-pdm
    Collaborator

    The fix of missing symbols is part of #850.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions