bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/3] selftest/bpf, riscv: Improved cross-building support
@ 2023-10-04 12:27 Björn Töpel
  2023-10-04 12:27 ` [PATCH bpf-next 1/3] selftests/bpf: Add cross-build support for urandom_read et al Björn Töpel
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Björn Töpel @ 2023-10-04 12:27 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Mykola Lysenko, bpf, netdev
  Cc: Björn Töpel, linux-kselftest, linux-kernel, linux-riscv

From: Björn Töpel <bjorn@rivosinc.com>

Yet another "more cross-building support for RISC-V" series.

An example how to invoke a gen_tar build:

  | make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- CC=riscv64-linux-gnu-gcc \
  |    HOSTCC=gcc O=/workspace/kbuild FORMAT= \
  |    SKIP_TARGETS="arm64 ia64 powerpc sparc64 x86 sgx" -j $(($(nproc)-1)) \
  |    -C tools/testing/selftests gen_tar


Björn

Björn Töpel (3):
  selftests/bpf: Add cross-build support for urandom_read et al
  selftests/bpf: Enable lld usage for RISC-V
  selftests/bpf: Add uprobe_multi to gen_tar target

 tools/testing/selftests/bpf/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)


base-commit: 2147c8d07e1abc8dfc3433ca18eed5295e230ede
-- 
2.39.2


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

* [PATCH bpf-next 1/3] selftests/bpf: Add cross-build support for urandom_read et al
  2023-10-04 12:27 [PATCH bpf-next 0/3] selftest/bpf, riscv: Improved cross-building support Björn Töpel
@ 2023-10-04 12:27 ` Björn Töpel
  2023-10-04 12:27 ` [PATCH bpf-next 2/3] selftests/bpf: Enable lld usage for RISC-V Björn Töpel
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Björn Töpel @ 2023-10-04 12:27 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Mykola Lysenko, bpf, netdev
  Cc: Björn Töpel, linux-kselftest, linux-kernel, linux-riscv

From: Björn Töpel <bjorn@rivosinc.com>

Some userland programs in the BPF test suite, e.g. urandom_read, is
missing cross-build support. Add cross-build support for these
programs

Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
---
 tools/testing/selftests/bpf/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 47365161b6fc..a9cbb85fa180 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -198,7 +198,7 @@ endif
 # do not fail. Static builds leave urandom_read relying on system-wide shared libraries.
 $(OUTPUT)/liburandom_read.so: urandom_read_lib1.c urandom_read_lib2.c liburandom_read.map
 	$(call msg,LIB,,$@)
-	$(Q)$(CLANG) $(filter-out -static,$(CFLAGS) $(LDFLAGS))   \
+	$(Q)$(CLANG) $(CLANG_TARGET_ARCH) $(filter-out -static,$(CFLAGS) $(LDFLAGS))   \
 		     $(filter %.c,$^) $(filter-out -static,$(LDLIBS)) \
 		     -fuse-ld=$(LLD) -Wl,-znoseparate-code -Wl,--build-id=sha1 \
 		     -Wl,--version-script=liburandom_read.map \
@@ -206,7 +206,7 @@ $(OUTPUT)/liburandom_read.so: urandom_read_lib1.c urandom_read_lib2.c liburandom
 
 $(OUTPUT)/urandom_read: urandom_read.c urandom_read_aux.c $(OUTPUT)/liburandom_read.so
 	$(call msg,BINARY,,$@)
-	$(Q)$(CLANG) $(filter-out -static,$(CFLAGS) $(LDFLAGS)) $(filter %.c,$^) \
+	$(Q)$(CLANG) $(CLANG_TARGET_ARCH) $(filter-out -static,$(CFLAGS) $(LDFLAGS)) $(filter %.c,$^) \
 		     -lurandom_read $(filter-out -static,$(LDLIBS)) -L$(OUTPUT)  \
 		     -fuse-ld=$(LLD) -Wl,-znoseparate-code -Wl,--build-id=sha1 \
 		     -Wl,-rpath=. -o $@
-- 
2.39.2


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

* [PATCH bpf-next 2/3] selftests/bpf: Enable lld usage for RISC-V
  2023-10-04 12:27 [PATCH bpf-next 0/3] selftest/bpf, riscv: Improved cross-building support Björn Töpel
  2023-10-04 12:27 ` [PATCH bpf-next 1/3] selftests/bpf: Add cross-build support for urandom_read et al Björn Töpel
@ 2023-10-04 12:27 ` Björn Töpel
  2023-10-04 12:27 ` [PATCH bpf-next 3/3] selftests/bpf: Add uprobe_multi to gen_tar target Björn Töpel
  2023-10-04 20:40 ` [PATCH bpf-next 0/3] selftest/bpf, riscv: Improved cross-building support patchwork-bot+netdevbpf
  3 siblings, 0 replies; 6+ messages in thread
From: Björn Töpel @ 2023-10-04 12:27 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Mykola Lysenko, bpf, netdev
  Cc: Björn Töpel, linux-kselftest, linux-kernel, linux-riscv

From: Björn Töpel <bjorn@rivosinc.com>

RISC-V has proper lld support. Use that, similar to what x86 does, for
urandom_read et al.

Signed-off-by: Björn Töpel <bjorn@rivosinc.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 a9cbb85fa180..098e32c684d5 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -188,7 +188,7 @@ $(OUTPUT)/%:%.c
 	$(Q)$(LINK.c) $^ $(LDLIBS) -o $@
 
 # LLVM's ld.lld doesn't support all the architectures, so use it only on x86
-ifeq ($(SRCARCH),x86)
+ifeq ($(SRCARCH),$(filter $(SRCARCH),x86 riscv))
 LLD := lld
 else
 LLD := ld
-- 
2.39.2


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

* [PATCH bpf-next 3/3] selftests/bpf: Add uprobe_multi to gen_tar target
  2023-10-04 12:27 [PATCH bpf-next 0/3] selftest/bpf, riscv: Improved cross-building support Björn Töpel
  2023-10-04 12:27 ` [PATCH bpf-next 1/3] selftests/bpf: Add cross-build support for urandom_read et al Björn Töpel
  2023-10-04 12:27 ` [PATCH bpf-next 2/3] selftests/bpf: Enable lld usage for RISC-V Björn Töpel
@ 2023-10-04 12:27 ` Björn Töpel
  2023-10-04 13:00   ` Jiri Olsa
  2023-10-04 20:40 ` [PATCH bpf-next 0/3] selftest/bpf, riscv: Improved cross-building support patchwork-bot+netdevbpf
  3 siblings, 1 reply; 6+ messages in thread
From: Björn Töpel @ 2023-10-04 12:27 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Mykola Lysenko, bpf, netdev
  Cc: Björn Töpel, linux-kselftest, linux-kernel, linux-riscv

From: Björn Töpel <bjorn@rivosinc.com>

The uprobe_multi program was not picked up for the gen_tar target. Fix
by adding it to TEST_GEN_FILES.

Signed-off-by: Björn Töpel <bjorn@rivosinc.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 098e32c684d5..07ac73cc339d 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -104,7 +104,7 @@ TEST_GEN_PROGS_EXTENDED = test_sock_addr test_skb_cgroup_id_user \
 	xskxceiver xdp_redirect_multi xdp_synproxy veristat xdp_hw_metadata \
 	xdp_features
 
-TEST_GEN_FILES += liburandom_read.so urandom_read sign-file
+TEST_GEN_FILES += liburandom_read.so urandom_read sign-file uprobe_multi
 
 # Emit succinct information message describing current building step
 # $1 - generic step name (e.g., CC, LINK, etc);
-- 
2.39.2


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

* Re: [PATCH bpf-next 3/3] selftests/bpf: Add uprobe_multi to gen_tar target
  2023-10-04 12:27 ` [PATCH bpf-next 3/3] selftests/bpf: Add uprobe_multi to gen_tar target Björn Töpel
@ 2023-10-04 13:00   ` Jiri Olsa
  0 siblings, 0 replies; 6+ messages in thread
From: Jiri Olsa @ 2023-10-04 13:00 UTC (permalink / raw)
  To: Björn Töpel
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Mykola Lysenko, bpf, netdev, Björn Töpel,
	linux-kselftest, linux-kernel, linux-riscv

On Wed, Oct 04, 2023 at 02:27:21PM +0200, Björn Töpel wrote:
> From: Björn Töpel <bjorn@rivosinc.com>
> 
> The uprobe_multi program was not picked up for the gen_tar target. Fix
> by adding it to TEST_GEN_FILES.
> 
> Signed-off-by: Björn Töpel <bjorn@rivosinc.com>

Acked-by: Jiri Olsa <jolsa@kernel.org>

thanks,
jirka


> ---
>  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 098e32c684d5..07ac73cc339d 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -104,7 +104,7 @@ TEST_GEN_PROGS_EXTENDED = test_sock_addr test_skb_cgroup_id_user \
>  	xskxceiver xdp_redirect_multi xdp_synproxy veristat xdp_hw_metadata \
>  	xdp_features
>  
> -TEST_GEN_FILES += liburandom_read.so urandom_read sign-file
> +TEST_GEN_FILES += liburandom_read.so urandom_read sign-file uprobe_multi
>  
>  # Emit succinct information message describing current building step
>  # $1 - generic step name (e.g., CC, LINK, etc);
> -- 
> 2.39.2
> 
> 

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

* Re: [PATCH bpf-next 0/3] selftest/bpf, riscv: Improved cross-building support
  2023-10-04 12:27 [PATCH bpf-next 0/3] selftest/bpf, riscv: Improved cross-building support Björn Töpel
                   ` (2 preceding siblings ...)
  2023-10-04 12:27 ` [PATCH bpf-next 3/3] selftests/bpf: Add uprobe_multi to gen_tar target Björn Töpel
@ 2023-10-04 20:40 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-10-04 20:40 UTC (permalink / raw)
  To: =?utf-8?b?QmrDtnJuIFTDtnBlbCA8Ympvcm5Aa2VybmVsLm9yZz4=?=
  Cc: ast, daniel, andrii, mykolal, bpf, netdev, bjorn,
	linux-kselftest, linux-kernel, linux-riscv

Hello:

This series was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:

On Wed,  4 Oct 2023 14:27:18 +0200 you wrote:
> From: Björn Töpel <bjorn@rivosinc.com>
> 
> Yet another "more cross-building support for RISC-V" series.
> 
> An example how to invoke a gen_tar build:
> 
>   | make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- CC=riscv64-linux-gnu-gcc \
>   |    HOSTCC=gcc O=/workspace/kbuild FORMAT= \
>   |    SKIP_TARGETS="arm64 ia64 powerpc sparc64 x86 sgx" -j $(($(nproc)-1)) \
>   |    -C tools/testing/selftests gen_tar
> 
> [...]

Here is the summary with links:
  - [bpf-next,1/3] selftests/bpf: Add cross-build support for urandom_read et al
    https://git.kernel.org/bpf/bpf-next/c/97a79e502e25
  - [bpf-next,2/3] selftests/bpf: Enable lld usage for RISC-V
    https://git.kernel.org/bpf/bpf-next/c/72fae6319962
  - [bpf-next,3/3] selftests/bpf: Add uprobe_multi to gen_tar target
    https://git.kernel.org/bpf/bpf-next/c/e096ab9d9f45

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2023-10-04 20:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-04 12:27 [PATCH bpf-next 0/3] selftest/bpf, riscv: Improved cross-building support Björn Töpel
2023-10-04 12:27 ` [PATCH bpf-next 1/3] selftests/bpf: Add cross-build support for urandom_read et al Björn Töpel
2023-10-04 12:27 ` [PATCH bpf-next 2/3] selftests/bpf: Enable lld usage for RISC-V Björn Töpel
2023-10-04 12:27 ` [PATCH bpf-next 3/3] selftests/bpf: Add uprobe_multi to gen_tar target Björn Töpel
2023-10-04 13:00   ` Jiri Olsa
2023-10-04 20:40 ` [PATCH bpf-next 0/3] selftest/bpf, riscv: Improved cross-building support patchwork-bot+netdevbpf

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).