Skip to content

meson: fix missing failure if bpf-framework was enabled#33793

Merged
bluca merged 1 commit intosystemd:mainfrom
martinetd:bpf-framework-check
Jul 20, 2024
Merged

meson: fix missing failure if bpf-framework was enabled#33793
bluca merged 1 commit intosystemd:mainfrom
martinetd:bpf-framework-check

Conversation

@martinetd
Copy link
Copy Markdown
Contributor

If building with clang and clang does not support bpf, then enabling -Dbpf-framework=enabled would silently drop the feature (even printing bpf-framework: enabled in the meson build recap, and no message anywhere that'd hint at the failure!)

This is unexpected, so add check to fail hard in this case.

All other code paths (gcc, missing bpftool) properly check for the option, but it is not as easy for a custom command so check explicitly


bit me on nixos that does unholy things to clang...

If building with clang and clang does not support bpf, then enabling
-Dbpf-framework=enabled would silently drop the feature (even printing
bpf-framework: enabled in the meson build recap, and no message anywhere
that'd hint at the failure!)

This is unexpected, so add check to fail hard in this case.

All other code paths (gcc, missing bpftool) properly check for the
option, but it is not as easy for a custom command so check explicitly
@github-actions github-actions bot added build-system meson please-review PR is ready for (re-)review by a maintainer labels Jul 20, 2024
martinetd added a commit to martinetd/nixpkgs that referenced this pull request Jul 20, 2024
systemd meson.build apparently didn't check properly that the option was
enabled in all code paths, so it was possible to build systemd such as
--version would have -BPF_FRAMEWORK (properly disabled in config.h) with
-Dbpf-framework=enabled.

Fix the failing check, which was `clang -target bpf` breaking with
zerocallusedregs hardening -- this is apparently a known problem as it's
disabled in quite a few other packages that mention bpf in comment above
the exception...

Link: systemd/systemd#33793
@bluca bluca merged commit 8da20e3 into systemd:main Jul 20, 2024
@github-actions github-actions bot removed the please-review PR is ready for (re-)review by a maintainer label Jul 20, 2024
Mic92 pushed a commit to Mic92/nixpkgs that referenced this pull request Jul 21, 2024
systemd meson.build apparently didn't check properly that the option was
enabled in all code paths, so it was possible to build systemd such as
--version would have -BPF_FRAMEWORK (properly disabled in config.h) with
-Dbpf-framework=enabled.

Fix the failing check, which was `clang -target bpf` breaking with
zerocallusedregs hardening -- this is apparently a known problem as it's
disabled in quite a few other packages that mention bpf in comment above
the exception...

Link: systemd/systemd#33793
(cherry picked from commit ef593db)
github-actions bot pushed a commit to NixOS/nixpkgs that referenced this pull request Jul 21, 2024
systemd meson.build apparently didn't check properly that the option was
enabled in all code paths, so it was possible to build systemd such as
--version would have -BPF_FRAMEWORK (properly disabled in config.h) with
-Dbpf-framework=enabled.

Fix the failing check, which was `clang -target bpf` breaking with
zerocallusedregs hardening -- this is apparently a known problem as it's
disabled in quite a few other packages that mention bpf in comment above
the exception...

Link: systemd/systemd#33793
(cherry picked from commit ef593db)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants