By default clang uses -mcpu=probe, which attempts to probe the current kernel to detect what eBPF features it can use / will be accepted by the kernel verifier.
It can also explicitly be set to v1, v2 or v3. Expose this (or maybe a generic means of passing flags to clang) to allow users to set this. It's useful for those that compile eBPF on one machine, and run it on another.
By default
clanguses-mcpu=probe, which attempts to probe the current kernel to detect what eBPF features it can use / will be accepted by the kernel verifier.It can also explicitly be set to
v1,v2orv3. Expose this (or maybe a generic means of passing flags to clang) to allow users to set this. It's useful for those that compile eBPF on one machine, and run it on another.