Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bpf: disable -Waddress-of-packed-member on newer clang versions
clang 4.0 and higher bails out when compiling cilium's eBPF programs with the following error: [...] In file included from bpf_lxc.c:41: ./lib/lb.h:167:33: error: taking address of packed member 'address' of class or structure 'lb6_reverse_nat' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] ipv6_addr_copy(&tuple->addr, &nat->address); ^~~~~~~~~~~~ [...] Disable the new -Waddress-of-packed-member warning as the verifier will eventually make the call whether a given access is fine or not. F.e., context, stack, (regs) can never be accessed unaligned, direct packet access and dynamic map value access may be accessed unaligned if the underlying architecture supports it, f.e. x86/arm64. Thus, just disable -Waddress-of-packed-member and make sure that earlier clang versions don't bail out on not supporting the warning by adding -Wno-unknown-warning-option to the flags. Closes #310 Reported-by: André Martins <andre@cilium.io> Signed-off-by: Daniel Borkmann <daniel@cilium.io>
- Loading branch information