Skip to content

Conversation

@qmonnet
Copy link
Member

@qmonnet qmonnet commented Jul 19, 2025

First, add the missing probe for libelf-zstd.

Once we have that, extend the CI matrix for the build.yml workflow, in order to run a job on Ubuntu 24.04. The new probe is not enough, though: we have issues with static build using the libbfd-based disassembler. Here, we work around the issue in a dirty way: we pass all dependency flags via the EXTRA_LDFLAGS (we need to pass -lzstd and -lsframe for libbfd, but the order of dependencies is significant and the LDFLAGS are before the deps (we could swap but don't want to, to remain close to the build feature system in the kernel).

@qmonnet qmonnet force-pushed the pr/elf-zstd-static branch 5 times, most recently from 60fe5dd to 1f80881 Compare July 19, 2025 03:11
qmonnet added 2 commits July 21, 2025 11:26
Add the probe to test whether we need to link against the zstd library
to use libelf in bpftool.

This should ideally have been merged before commit 67f1758
("bpftool: Link zstd lib required by libelf"), where we have the
Makefile use the actual feature, but I forgot to add the probe when
synchronising the repository.

Elfutils commit a5b07cdf9c49 adds support for ZSTD compression, first
shipped with elfutils 0.189. Distros now have it; for example, Ubuntu
22.04 ships version 0.186 (or 0.188 in backports), but Ubuntu 24.04 has
0.189 or 0.190 depending on the arch.

While we edit the Makefile.feature, make sure to send the output to
/dev/null (rather than '-', sometimes interpreted as a file name) for
all probes for which we don't need grepping from the output.

Link: https://sourceware.org/git/?p=elfutils.git;a=commit;h=a5b07cdf9c491fb7a4a16598c482c68b718f59b9
Signed-off-by: Quentin Monnet <[email protected]>
Add a matrix job to run the build on Ubuntu 24.04 runners.

This requires cheating to make the static build with libbfd-based
disassembler work: we manually pass all required libraries via the
$(LIBS) variable, given that the Makefile.feature is not able to tell
about -lzstd or -lsframe for libbfd yet.

Signed-off-by: Quentin Monnet <[email protected]>
@qmonnet qmonnet force-pushed the pr/elf-zstd-static branch from 1f80881 to c586949 Compare July 21, 2025 10:29
We get the following lint warning on GitHub Pull Requests:

    The 'as' keyword should match the case of the 'from' keyword

    FromAsCasing: 'as' and 'FROM' keywords' casing do not match
    More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

Let's fix it.

Signed-off-by: Quentin Monnet <[email protected]>
@qmonnet qmonnet merged commit 0b95850 into libbpf:main Jul 21, 2025
6 checks passed
@qmonnet qmonnet deleted the pr/elf-zstd-static branch July 21, 2025 10:50
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