Open saxena-anurag opened 8 months ago
Bpf2c should reject if this is not the MSVC version of Clang/LLVM.
I disagree. I would say to just warn (not reject). If a newer clang passes verification it can be significantly more performant which might be important for some customers. If there's a technical reason to reject more performant code, please state it.
ebpf-for-windows currently only supports clang
v11.0.1
. If someone is using a newer clang version to compile their eBPF program, the program may fail the verification and it is not easy to figure out that the issue is with the clang version used.It looks like clang embeds the version in the ELF file in
.debug_str
section like below:We can probably update ebpfapi and bpf2c to check the clang version before invoking the verifier, and fail verification with clear error message stating that wrong version of clang was used.