Skip to content
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

build: Don't build cloned_binary as part of crun #1609

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

darktohka
Copy link

@darktohka darktohka commented Nov 28, 2024

Building crun after commit 8a0ee4b yields the following link error:

2024-11-28T01:45:15.2415817Z   CCLD     libcrun.la
2024-11-28T01:45:15.3802217Z   CCLD     crun
2024-11-28T01:45:15.4957602Z /home/runner/work/zebrafish/zebrafish/buildroot/output/host/lib/gcc/x86_64-buildroot-linux-gnu/13.3.0/../../../../x86_64-buildroot-linux-gnu/bin/ld: src/libcrun/crun-cloned_binary.o: in function `ensure_cloned_binary':
2024-11-28T01:45:15.4959563Z cloned_binary.c:(.text+0x87c): undefined reference to `get_bind_mount'
2024-11-28T01:45:15.4961482Z /home/runner/work/zebrafish/zebrafish/buildroot/output/host/lib/gcc/x86_64-buildroot-linux-gnu/13.3.0/../../../../x86_64-buildroot-linux-gnu/bin/ld: cloned_binary.c:(.text+0x8b7): undefined reference to `crun_error_release'
2024-11-28T01:45:15.4973731Z collect2: error: ld returned 1 exit status
2024-11-28T01:45:15.4989126Z make[3]: *** [Makefile:1547: crun] Error 1

This is because 8a0ee4b adds an include to "linux.h" (which has get_bind_mount and a transitive include to "error.h" which has crun_error_release). The Makefile for crun the binary builds src/libcrun/cloned_binary.c... which is already built as part of libcrun the library which is linked directly to crun.

Therefore it's enough to remove the src/libcrun/cloned_binary.c file from crun sources, it is already included through the link step.

An alternative would be to add src/libcrun/error.c, src/libcrun/utils.c, src/libcrun/linux.c to the crun sources, but that would be too much unnecessary bloat.

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