On Friday, October 18, 2019 9:59:11 AM EDT Chris Adams wrote:
Once upon a time, Tom Hughes <tom(a)compton.nu> said:
> Well I imagine clang will define it when targetting x86_64 output
> but in this case he is targetting BPF output instead.
>
> Adding -D__x86_64__ to the command line may be the quickest workaround
> for now though.
Yes, but in my VERY limited understanding, a given compiled eBPF object
is only for the specific kernel it was compiled against. The kernel
headers define structures differently for different architectures, so to
use them, you have to have the right defines in the compiler.
There's probably a better way than just using -D__x86_64__ though, since
that would (obviously) only be correct on x86_64. Fedora supports other
architectures, so there should be a more generic way to get the correct
architecture macros defined.
Passing the __x86_64__ flag seems to work. At least it works for one arch.
-Steve