Add a new BPF_SELFTEST_32BIT variable to enable sub-register code-gen test mode. For example:
make BPF_SELFTEST_32BIT=1 -C tools/testing/selftests/bpf run_tests will compile all bpf C program with sub-register code-gen enabled, ALU32 and JMP32 instructions will be used. Signed-off-by: Jiong Wang <jiong.w...@netronome.com> --- tools/testing/selftests/bpf/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 73aa6d8..70bccf6 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -146,6 +146,10 @@ endif endif endif +ifneq ($(BPF_SELFTEST_32BIT),) + LLC_FLAGS += -mattr=alu32 +endif + # Have one program compiled without "-target bpf" to test whether libbpf loads # it successfully $(OUTPUT)/test_xdp.o: test_xdp.c -- 2.7.4