diff options
| author | Jose E. Marchesi <[email protected]> | 2024-01-30 12:03:43 +0100 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2024-01-30 16:08:18 +0100 |
| commit | 27a90b14b93d3b2e1efd10764e456af7e2a42991 (patch) | |
| tree | d830754421a89bf6005406d6e13f276796662a78 /tools/testing/selftests/bpf/prog_tests/autoload.c | |
| parent | 6668e818f960b0f32110a9efa7c97351a5771b35 (diff) | |
bpf: Build type-punning BPF selftests with -fno-strict-aliasing
A few BPF selftests perform type punning and they may break strict
aliasing rules, which are exploited by both GCC and clang by default
while optimizing. This can lead to broken compiled programs.
This patch disables strict aliasing for these particular tests, by
mean of the -fno-strict-aliasing command line option. This will make
sure these tests are optimized properly even if some strict aliasing
rule gets violated.
After this patch, GCC is able to build all the selftests without
warning about potential strict aliasing issue.
bpf@vger discussion on strict aliasing and BPF selftests:
https://lore.kernel.org/bpf/[email protected]/T/#t
Tested in bpf-next master.
No regressions.
Signed-off-by: Jose E. Marchesi <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/autoload.c')
0 files changed, 0 insertions, 0 deletions