All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yonghong Song <yonghong.song@linux.dev>
To: Cupertino Miranda <cupertino.miranda@oracle.com>, bpf@vger.kernel.org
Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	Andrii Nakryiko <andrii.nakryiko@gmail.com>,
	Eduard Zingerman <eddyz87@gmail.com>,
	David Faust <david.faust@oracle.com>,
	Jose Marchesi <jose.marchesi@oracle.com>,
	Elena Zannoni <elena.zannoni@oracle.com>
Subject: Re: [PATCH bpf-next 1/2] selftests/bpf: Add CFLAGS per source file and runner
Date: Mon, 6 May 2024 12:56:08 -0700	[thread overview]
Message-ID: <feadcc71-126c-48be-b2b6-a9e62a79da39@linux.dev> (raw)
In-Reply-To: <20240506151829.186607-2-cupertino.miranda@oracle.com>


On 5/6/24 8:18 AM, Cupertino Miranda wrote:
> This patch adds support to specify CFLAGS per source file and per test
> runner.
>
> Signed-off-by: Cupertino Miranda <cupertino.miranda@oracle.com>
> Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>
> Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>
> Cc: Eduard Zingerman <eddyz87@gmail.com>
> Cc: Yonghong Song <yonghong.song@linux.dev>
> Cc: David Faust <david.faust@oracle.com>
> Cc: Jose Marchesi <jose.marchesi@oracle.com>
> Cc: Elena Zannoni <elena.zannoni@oracle.com>

Ack with a nit below.

Acked-by: Yonghong Song <yonghong.song@linux.dev>

> ---
>   tools/testing/selftests/bpf/Makefile | 15 ++++++++-------
>   1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> index ba28d42b74db..e506a5948cc2 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -81,11 +81,11 @@ TEST_INST_SUBDIRS += bpf_gcc
>   # The following tests contain C code that, although technically legal,
>   # triggers GCC warnings that cannot be disabled: declaration of
>   # anonymous struct types in function parameter lists.
> -progs/btf_dump_test_case_bitfields.c-CFLAGS := -Wno-error
> -progs/btf_dump_test_case_namespacing.c-CFLAGS := -Wno-error
> -progs/btf_dump_test_case_packing.c-CFLAGS := -Wno-error
> -progs/btf_dump_test_case_padding.c-CFLAGS := -Wno-error
> -progs/btf_dump_test_case_syntax.c-CFLAGS := -Wno-error
> +progs/btf_dump_test_case_bitfields.c-bpf_gcc-CFLAGS := -Wno-error
> +progs/btf_dump_test_case_namespacing.c-bpf_gcc-CFLAGS := -Wno-error
> +progs/btf_dump_test_case_packing.c-bpf_gcc-CFLAGS := -Wno-error
> +progs/btf_dump_test_case_padding.c-bpf_gcc-CFLAGS := -Wno-error
> +progs/btf_dump_test_case_syntax.c-bpf_gcc-CFLAGS := -Wno-error
>   endif
>   
>   ifneq ($(CLANG_CPUV4),)
> @@ -498,7 +498,7 @@ endef
>   # Using TRUNNER_XXX variables, provided by callers of DEFINE_TEST_RUNNER and
>   # set up by DEFINE_TEST_RUNNER itself, create test runner build rules with:
>   # $1 - test runner base binary name (e.g., test_progs)
> -# $2 - test runner extra "flavor" (e.g., no_alu32, cpuv4, gcc-bpf, etc)
> +# $2 - test runner extra "flavor" (e.g., no_alu32, cpuv4, bpf_gcc, etc)
>   define DEFINE_TEST_RUNNER_RULES

The gcc-bpf below also needs an update.

# $2 - test runner extra "flavor" (e.g., no_alu32, cpuv4, gcc-bpf, etc)
define DEFINE_TEST_RUNNER

>   
>   ifeq ($($(TRUNNER_OUTPUT)-dir),)
> @@ -521,7 +521,8 @@ $(TRUNNER_BPF_OBJS): $(TRUNNER_OUTPUT)/%.bpf.o:				\
>   		     | $(TRUNNER_OUTPUT) $$(BPFOBJ)
>   	$$(call $(TRUNNER_BPF_BUILD_RULE),$$<,$$@,			\
>   					  $(TRUNNER_BPF_CFLAGS)         \
> -					  $$($$<-CFLAGS))
> +					  $$($$<-CFLAGS)		\
> +					  $$($$<-$2-CFLAGS))
>   
>   $(TRUNNER_BPF_SKELS): %.skel.h: %.bpf.o $(BPFTOOL) | $(TRUNNER_OUTPUT)
>   	$$(call msg,GEN-SKEL,$(TRUNNER_BINARY),$$@)

  reply	other threads:[~2024-05-06 19:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-06 15:18 [PATCH bpf-next 0/2] selftests/bpf: Fix number of arguments in test Cupertino Miranda
2024-05-06 15:18 ` [PATCH bpf-next 1/2] selftests/bpf: Add CFLAGS per source file and runner Cupertino Miranda
2024-05-06 19:56   ` Yonghong Song [this message]
2024-05-06 15:18 ` [PATCH bpf-next 2/2] selftests/bpf: Change functions definitions to support GCC Cupertino Miranda
2024-05-06 19:57   ` Yonghong Song
2024-05-06 21:44   ` Andrii Nakryiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=feadcc71-126c-48be-b2b6-a9e62a79da39@linux.dev \
    --to=yonghong.song@linux.dev \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=cupertino.miranda@oracle.com \
    --cc=david.faust@oracle.com \
    --cc=eddyz87@gmail.com \
    --cc=elena.zannoni@oracle.com \
    --cc=jose.marchesi@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.