bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next] bpf: add a few more options for GCC_BPF in selftests/bpf/Makefile
@ 2024-04-24  8:41 Jose E. Marchesi
  2024-04-24 16:47 ` Eduard Zingerman
  2024-04-24 21:05 ` Yonghong Song
  0 siblings, 2 replies; 12+ messages in thread
From: Jose E. Marchesi @ 2024-04-24  8:41 UTC (permalink / raw)
  To: bpf
  Cc: Jose E . Marchesi, Yonghong Song, Eduard Zingerman, david.faust,
	cupertino.miranda

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.

 -mco-re
   This tells GCC to generate CO-RE relocations in .BTF.ext.

 -masm=pseudoc
   This tells GCC to emit BPF assembler using the pseudo-c syntax.

Tested in bpf-next master.
No regressions.

Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com>
Cc: Yonghong Song <yhs@meta.com>
Cc: Eduard Zingerman <eddyz87@gmail.com>
Cc: david.faust@oracle.com
Cc: cupertino.miranda@oracle.com
---
 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
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-04-26 14:47 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-24  8:41 [PATCH bpf-next] bpf: add a few more options for GCC_BPF in selftests/bpf/Makefile Jose E. Marchesi
2024-04-24 16:47 ` Eduard Zingerman
2024-04-24 21:05 ` Yonghong Song
2024-04-24 21:24   ` Jose E. Marchesi
2024-04-24 21:47     ` David Faust
2024-04-24 21:48     ` Alexei Starovoitov
2024-04-25 12:32       ` Jose E. Marchesi
2024-04-25 15:40         ` Alexei Starovoitov
2024-04-26 14:41           ` Jose E. Marchesi
2024-04-26 14:47             ` Alexei Starovoitov
2024-04-25 18:20         ` Andrii Nakryiko
2024-04-25 18:48           ` Jose E. Marchesi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).