On 4/24/24 1:41 AM, Jose E. Marchesi wrote:
This little patch modifies selftests/bpf/Makefile so it passes the
following extra options when invoking gcc-bpf:
-gbtf
This makes GCC to emit BTF debug info in .BTF and .BTF.ext.
Could we do if '-g' is specified, for bpf program,
btf will be automatically generated?
-mco-re
This tells GCC to generate CO-RE relocations in .BTF.ext.
Can we make this default? That is, remove -mco-re option. I
can imagine for any serious bpf program, co-re is a must.
-masm=pseudoc
This tells GCC to emit BPF assembler using the pseudo-c syntax.
Can we make it the other way round such that -masm=pseudoc is
the default? You can have an option e.g., -masm=non-pseudoc,
for the other format?
Tested in bpf-next master.
No regressions.
Signed-off-by: Jose E. Marchesi <jose.marchesi@xxxxxxxxxx>
Cc: Yonghong Song <yhs@xxxxxxxx>
Cc: Eduard Zingerman <eddyz87@xxxxxxxxx>
Cc: david.faust@xxxxxxxxxx
Cc: cupertino.miranda@xxxxxxxxxx
---
tools/testing/selftests/bpf/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index edc73f8f5aef..702428021132 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -442,7 +442,7 @@ endef
# Build BPF object using GCC
define GCC_BPF_BUILD_RULE
$(call msg,GCC-BPF,$(TRUNNER_BINARY),$2)
- $(Q)$(BPF_GCC) $3 -O2 -c $1 -o $2
+ $(Q)$(BPF_GCC) $3 -O2 -gbtf -mco-re -masm=pseudoc -c $1 -o $2
endef
SKEL_BLACKLIST := btf__% test_pinning_invalid.c test_sk_assign.c