Open mejedi opened 1 month ago
We intend to build an improved bpf2go
tool. Major features
We need to identify source code files, package them somehow and ship into a Docker container. An idea I was toying with was to use a VFS overlay.
Instead we could just render a filesystem tree in /tmp
, which might be a better option (this bug, -vfsoverlay
missing in older clang
s).
VFS overlay (
-vfsoverlay
, sparsely documented inllvm
'sllvm/include/llvm/Support/VirtualFileSystem.h
) enablesclang
to consume files from a "virtual filesystem image". An image is defined in ayaml
file, e.g.:Unconventionally, BPF backend reads the source files to embed source code in bpf object (to improve verifier error diagnostics). It bypasses the VFS overlay and fails to find
foobar/input.c
. End result: no source code embedded / worse error diagnostics.