Skip to content

lkl: fix hijack and zpoline parallel builds #612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ddiss
Copy link

@ddiss ddiss commented Jul 4, 2025

This is a follow up change for commit 3c97822 ("lkl: add tests build barrier") tracked via #558. The hijack and zpoline libraries also share object files, so need a barrier to avoid parallel build failures.

@ddiss ddiss marked this pull request as draft July 4, 2025 07:40
@ddiss
Copy link
Author

ddiss commented Jul 4, 2025

This is fixing the parallel build failures I raised in #558 (comment) with make-4.4.1-3.3 (openSUSE Tumbleweed) , but it strangely doesn't work with make-4.2.1-7.3.2 (Leap 15.6). The .WAIT install filter appears to be broken:

make -f /home/david/kernel/lkl/tools/build/Makefile.build dir=. obj=lklfuse
make -f /home/david/kernel/lkl/tools/build/Makefile.build dir=lib obj=liblkl
make -f /home/david/kernel/lkl/tools/build/Makefile.build dir=tests obj=disk
make -f /home/david/kernel/lkl/tools/build/Makefile.build dir=tests obj=boot
make -f /home/david/kernel/lkl/tools/build/Makefile.build dir=tests obj=disk-vfio-pci
make -f /home/david/kernel/lkl/tools/build/Makefile.build dir=tests obj=net-test
make -f /home/david/kernel/lkl/tools/build/Makefile.build dir=tests obj=config
make -f /home/david/kernel/lkl/tools/build/Makefile.build dir=tests obj=test-dlmopen
make -f /home/david/kernel/lkl/tools/build/Makefile.build dir=lib/hijack obj=liblkl-hijack
make -f /home/david/kernel/lkl/tools/build/Makefile.build dir=lib/hijack obj=liblkl-zpoline
\
    install -d /home/david/install/here/usr/include ; \
    install -m 644 include/lkl.h include/lkl_host.h /home/david/kernel/lkl/tools/lkl/include/lkl_autoconf.h \
      include/lkl_config.h /home/david/install/here/usr/include ; \
    cp -r /home/david/kernel/lkl/tools/lkl/include/lkl /home/david/install/here/usr/include
\
    install -d /home/david/install/here/usr/lib ; \
    install -m 644 /home/david/kernel/lkl/tools/lkl/lib/liblkl.so /home/david/kernel/lkl/tools/lkl/lib/hijack/liblkl-hijack.so .WAIT /home/david/kernel/lkl/tools/lkl/lib/hijack/liblkl-zpoline.so /home/david/kernel/lkl/tools/lkl/liblkl.a /home/david/install/here/usr/lib
install: cannot stat '.WAIT': No such file or directory
make: *** [Makefile:180: libraries_install] Error 1

@ddiss
Copy link
Author

ddiss commented Jul 4, 2025

This is fixing the parallel build failures I raised in #558 (comment) with make-4.4.1-3.3 (openSUSE Tumbleweed) , but it strangely doesn't work with make-4.2.1-7.3.2 (Leap 15.6). The .WAIT install filter appears to be broken:

ah, the expand-targets filter isn't supposed to remove the .WAIT target, only avoid adding $(EXESUF) / $(SOSUF) to it.

@ddiss
Copy link
Author

ddiss commented Jul 4, 2025

This is fixing the parallel build failures I raised in #558 (comment) with make-4.4.1-3.3 (openSUSE Tumbleweed) , but it strangely doesn't work with make-4.2.1-7.3.2 (Leap 15.6). The .WAIT install filter appears to be broken:

ah, the expand-targets filter isn't supposed to remove the .WAIT target, only avoid adding $(EXESUF) / $(SOSUF) to it.

This extra change seems to work, but it's not exactly pretty:

--- a/tools/lkl/Makefile
+++ b/tools/lkl/Makefile
@@ -177,9 +177,9 @@ headers_install: $(TARGETS)
            cp -r $(OUTPUT)include/lkl $(DESTDIR)$(INCDIR)
 
 libraries_install: $(call expand-targets,$(libs-y),$(SOSUF)) $(OUTPUT)liblkl.a
-       $(call QUIET_INSTALL, libraries) \
+       $(if $(filter .%,$^),,$(call QUIET_INSTALL, libraries) \
            install -d $(DESTDIR)$(LIBDIR) ; \
-           install -m 644 $^ $(DESTDIR)$(LIBDIR)
+           install -m 644 $^ $(DESTDIR)$(LIBDIR))

Will squash this into the commit, but please feel free to suggest something cleaner.

This is a follow up change for commit 3c97822 ("lkl: add tests
build barrier") tracked via lkl#558.
The hijack and zpoline libraries also share object files, so need a
barrier to avoid parallel build failures.

Signed-off-by: David Disseldorp <[email protected]>
@ddiss ddiss force-pushed the fix_hijack_zpoline_parallel_build branch from f54c767 to 4ee5d9b Compare July 4, 2025 10:59
@ddiss
Copy link
Author

ddiss commented Jul 4, 2025

v2:

  • filter .WAIT target from install invocation

@ddiss
Copy link
Author

ddiss commented Jul 7, 2025

make install rule still isn't working for older distros. keeping this flagged as draft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant