diff options
author | Ian Rogers <irogers@google.com> | 2020-07-20 09:17:41 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-07-21 23:26:25 +0300 |
commit | da7a35062bcccd3f67779a357065ba707b02ff2b (patch) | |
tree | abe364c7964ce93163f3dcd4dbdb74d8c19e2b28 /tools/bpf | |
parent | 94ad428df53688a1f80ab55f2b1186101510a778 (diff) | |
download | linux-da7a35062bcccd3f67779a357065ba707b02ff2b.tar.xz |
libbpf bpf_helpers: Use __builtin_offsetof for offsetof
The non-builtin route for offsetof has a dependency on size_t from
stdlib.h/stdint.h that is undeclared and may break targets.
The offsetof macro in bpf_helpers may disable the same macro in other
headers that have a #ifdef offsetof guard. Rather than add additional
dependencies improve the offsetof macro declared here to use the
builtin that is available since llvm 3.7 (the first with a BPF backend).
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200720061741.1514673-1-irogers@google.com
Diffstat (limited to 'tools/bpf')
0 files changed, 0 insertions, 0 deletions