build: remove 32-bit library dependencies for eBPF compilation - #191
Merged
Merged
Conversation
Including <string.h> in BPF kernel-space programs (radostrace.bpf.c and osdtrace.bpf.c) caused clang -target bpf to pull in glibc's <features.h> and <gnu/stubs.h>. Because __x86_64__ is not defined when targeting BPF, gnu/stubs.h fell back to requiring <gnu/stubs-32.h>, creating an artificial dependency on 32-bit glibc development headers (libc6-dev-i386 on Debian/ Ubuntu and glibc-devel.i686 on RHEL/CentOS/Rocky). eBPF programs run in kernel/BPF context and do not link against glibc. The only function used from <string.h> was memset. Remove <string.h> from BPF programs and call the compiler intrinsic __builtin_memset directly in radostrace.bpf.c and osdtrace.bpf.c, and include <stddef.h> in bpf_utils.h for size_t. Drop libc6-dev-i386 and glibc-devel.i686 from debian/control, documentation, tools, and CI workflows.
taodd
force-pushed
the
fix/remove-32bit-dependency
branch
from
September 3, 2026 10:32
aa72056 to
5e4e05f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Including
<string.h>in BPF kernel-space programs (radostrace.bpf.candosdtrace.bpf.c) causedclang -target bpfto pull in glibc's<features.h>and<gnu/stubs.h>. Because__x86_64__is not defined when targeting BPF,gnu/stubs.hfell back to requiring<gnu/stubs-32.h>, creating an artificial dependency on 32-bit glibc development headers (libc6-dev-i386on Debian/Ubuntu andglibc-devel.i686on RHEL/CentOS/Rocky).eBPF programs run in kernel/BPF context and do not link against glibc. The only function used from
<string.h>wasmemset.Changes
#include <string.h>fromsrc/radostrace.bpf.candsrc/osdtrace.bpf.c.memsetcalls insrc/radostrace.bpf.candsrc/osdtrace.bpf.cwith compiler builtin__builtin_memsetdirectly.<stddef.h>(freestanding compiler header) insrc/bpf_utils.hforsize_t.libc6-dev-i386andglibc-devel.i686fromdebian/control, documentation (doc/getting-started.md,doc/building.md), tools (tools/gen_dwarf_for_version.sh), and CI workflows (.github/workflows/).