From: Quentin Monnet <qmo@kernel.org>
To: John Hubbard <jhubbard@nvidia.com>, Shuah Khan <shuah@kernel.org>
Cc: Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <bentiss@kernel.org>,
Justin Stitt <justinstitt@google.com>,
Peter Hutterer <peter.hutterer@who-t.net>,
Jason Gerecke <jason.gerecke@wacom.com>,
Joshua Dickens <joshua@joshua-dickens.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>,
Eduard Zingerman <eddyz87@gmail.com>, 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@google.com>, Hao Luo <haoluo@google.com>,
Jiri Olsa <jolsa@kernel.org>,
bpf@vger.kernel.org, linux-input@vger.kernel.org,
Valentin Obst <kernel@valentinobst.de>,
linux-kselftest@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
llvm@lists.linux.dev
Subject: Re: [PATCH] bpftool, selftests/hid/bpf: fix 29 clang warnings
Date: Sun, 5 May 2024 23:36:14 +0100 [thread overview]
Message-ID: <4f947691-bf25-460b-bc08-da29de3fdaa6@kernel.org> (raw)
In-Reply-To: <20240505215636.63592-1-jhubbard@nvidia.com>
On 05/05/2024 22:56, John Hubbard wrote:
> When building either tools/bpf/bpftool, or tools/testing/selftests/hid,
> (the same Makefile is used for these), clang generates many instances of
> a warning that is useless here:
>
> "clang: warning: -lLLVM-17: 'linker' input unused"
>
> Silence this in both locations, by disabling that warning when building
> with clang.
>
> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
> ---
> tools/bpf/bpftool/Makefile | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
> index e9154ace80ff..c7457921d136 100644
> --- a/tools/bpf/bpftool/Makefile
> +++ b/tools/bpf/bpftool/Makefile
> @@ -133,6 +133,10 @@ CFLAGS += -DUSE_LIBCAP
> LIBS += -lcap
> endif
>
> +ifneq ($(LLVM),)
> + CFLAGS += -Wno-unused-command-line-argument
> +endif
Thanks! If possible, I'd rather keep the warning enabled, and fix the
command line instead. Looking at the error and the Makefile, we may not
need the -lLLVM<version> in the CFLAGS at all, but only in $(LIBS). On
my setup, I can build successfully, without the warnings, with the
following patch:
------
diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index b67454b45a49..dfa4f1bebbb3 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -147,7 +147,7 @@ ifeq ($(feature-llvm),1)
# If LLVM is available, use it for JIT disassembly
CFLAGS += -DHAVE_LLVM_SUPPORT
LLVM_CONFIG_LIB_COMPONENTS := mcdisassembler all-targets
- CFLAGS += $(shell $(LLVM_CONFIG) --cflags --libs $(LLVM_CONFIG_LIB_COMPONENTS))
+ CFLAGS += $(shell $(LLVM_CONFIG) --cflags)
LIBS += $(shell $(LLVM_CONFIG) --libs $(LLVM_CONFIG_LIB_COMPONENTS))
ifeq ($(shell $(LLVM_CONFIG) --shared-mode),static)
LIBS += $(shell $(LLVM_CONFIG) --system-libs $(LLVM_CONFIG_LIB_COMPONENTS))
------
Could you please check whether that works on your side, too?
Quentin
next prev parent reply other threads:[~2024-05-05 22:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-05 21:56 [PATCH] bpftool, selftests/hid/bpf: fix 29 clang warnings John Hubbard
2024-05-05 22:36 ` Quentin Monnet [this message]
2024-05-05 22:48 ` John Hubbard
2024-05-05 22:51 ` Quentin Monnet
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=4f947691-bf25-460b-bc08-da29de3fdaa6@kernel.org \
--to=qmo@kernel.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bentiss@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=jason.gerecke@wacom.com \
--cc=jhubbard@nvidia.com \
--cc=jikos@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=joshua@joshua-dickens.com \
--cc=justinstitt@google.com \
--cc=kernel@valentinobst.de \
--cc=kpsingh@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=martin.lau@linux.dev \
--cc=peter.hutterer@who-t.net \
--cc=sdf@google.com \
--cc=shuah@kernel.org \
--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