linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Sam James <sam@gentoo.org>,
	bpf@vger.kernel.org, Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	Stanislav Fomichev <sdf@fomichev.me>, Hao Luo <haoluo@google.com>,
	Jiri Olsa <jolsa@kernel.org>, Quentin Monnet <qmo@kernel.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tools/libbpf: add WERROR option
Date: Mon, 7 Jul 2025 15:18:05 +0200	[thread overview]
Message-ID: <c883e328-9d08-4a6c-b02a-f33e0e287555@iogearbox.net> (raw)
In-Reply-To: <7e6c41e47c6a8ab73945e6aac319e0dd53337e1b.1751712192.git.sam@gentoo.org>

On 7/5/25 12:43 PM, Sam James wrote:
> Check the 'WERROR' variable and suppress adding '-Werror' if WERROR=0.
> 
> This mirrors what tools/perf and other directories in tools do to handle
> -Werror rather than adding it unconditionally.

Could you also add to the commit desc why you need it? Are there particular
warnings you specifically need to suppress when building under gentoo?

> Signed-off-by: Sam James <sam@gentoo.org>
> ---
>   tools/lib/bpf/Makefile | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> index 168140f8e646..9563d37265da 100644
> --- a/tools/lib/bpf/Makefile
> +++ b/tools/lib/bpf/Makefile
> @@ -77,10 +77,15 @@ else
>     CFLAGS := -g -O2
>   endif
>   
> +# Treat warnings as errors unless directed not to
> +ifneq ($(WERROR),0)
> +  CFLAGS += -Werror
> +endif

Should we also add sth similar to tools/bpf/bpftool/Makefile and by default
enforce with -Werror with the option to disable?

>   # Append required CFLAGS
>   override CFLAGS += -std=gnu89
>   override CFLAGS += $(EXTRA_WARNINGS) -Wno-switch-enum
> -override CFLAGS += -Werror -Wall
> +override CFLAGS += -Wall
>   override CFLAGS += $(INCLUDES)
>   override CFLAGS += -fvisibility=hidden
>   override CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64


  reply	other threads:[~2025-07-07 13:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-05 10:43 [PATCH] tools/libbpf: add WERROR option Sam James
2025-07-07 13:18 ` Daniel Borkmann [this message]
2025-07-07 13:33   ` Quentin Monnet
2025-07-13  6:21     ` Sam James
2025-07-13  6:23   ` Sam James
2025-07-13 22:45     ` Alexei Starovoitov
2025-07-13 22:58       ` Sam James
2025-07-13 23:03         ` Alexei Starovoitov

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=c883e328-9d08-4a6c-b02a-f33e0e287555@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=eddyz87@gmail.com \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=qmo@kernel.org \
    --cc=sam@gentoo.org \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /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 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).