From: Quentin Monnet <quentin@isovalent.com>
To: Nathan Chancellor <nathan@kernel.org>, No Name <xbjfk.github@gmail.com>
Cc: linux-kernel@vger.kernel.org, ndesaulniers@google.com,
llvm@lists.linux.dev, bpf@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@kernel.org>
Subject: Re: LLVM not detected in bpfutil due to LLVM 16 requiring c++17
Date: Fri, 14 Apr 2023 17:26:07 +0100 [thread overview]
Message-ID: <c8168a87-7c98-caf9-5bf3-5779120b3121@isovalent.com> (raw)
In-Reply-To: <20230414154333.GA1931632@dev-arch.thelio-3990X>
Hi Nathan, Reagan, thanks for the report and CC,
2023-04-14 08:43 UTC-0700 ~ Nathan Chancellor <nathan@kernel.org>
> Hi Reagan,
>
> On Fri, Apr 14, 2023 at 10:36:35PM +1200, No Name wrote:
>> This is my first time reporting a bug, so apologies if I get something wrong.
>
> Thanks for the report! "See something, say something", even if it is not
> quite right out of the gate, we can get down to the bottom of it.
>
>> In tools/build/feature/Makefile, line 342, the c++ std is set to
>> gnu++14, whereas LLVM 16 now requires c++17 to include the headers.
>> This results in the llvm feature being falsely disabled for bpfutil.
>
> I cannot find any reference to bpfutil either in tree or when doing a
> web search, did you mean bpftool? I am going to assume yes, so I have
> gone ahead and added Quentin (the maintainer of bpftool in MAINTAINERS)
> and bpf@vger.kernel.org to the thread.
>
>> Perhaps the --cxxflags, --ldflags and --libs options of llvm-config
>> should instead?
>
> The tools system is pretty much Greek to me, so I am hoping someone else
> will have a better idea of what is going on and how to fix it.
>
> For the record, I think I see the issue you are talking about on Fedora,
> which has clang-16, whereas I do not see the same issue on Arch Linux,
> which still has clang-15.
>
> $ clang --version | head -1
> clang version 15.0.7
>
> $ make -C tools/bpf/bpftool -j(nproc) -s
>
> Auto-detecting system features:
> ... clang-bpf-co-re: [ on ]
> ... llvm: [ on ]
> ... libcap: [ on ]
> ... libbfd: [ on ]
>
> compared to
>
> $ clang --version | head -1
> clang version 16.0.0 (Fedora 16.0.0-1.fc39)
>
> $ make -C tools/bpf/bpftool -j(nproc) -s
>
> Auto-detecting system features:
> ... clang-bpf-co-re: [ on ]
> ... llvm: [ OFF ]
> ... libcap: [ on ]
> ... libbfd: [ on ]
>
> This is the output of tools/build/feature/test-llvm.make.output on my
> machine, which seems to confirm that the headers expect to be compiled
> with '-std=c++17', but that is just a superficial observation at this
> point.
>
+Cc Arnaldo, as I believe perf uses the 'llvm' feature as well.
I noticed the same on my machine some time ago, but haven't investigated
yet. The error I get in test-llvm.make.output seems to be exactly the same.
I confirm I can fix detection by using '-std=c++17' instead. It looks
like the version was bumped earlier in commit d0d0f0c12461 ("tools: Bump
minimum LLVM C++ std to GNU++14").
Reagan's suggestion to use '$(shell $(LLVM_CONFIG) --cxxflags)' instead
of specifying the standard manually works as well on my setup, and looks
cleaner to me. But I'm not sure of the impact this change would have,
and if it might break other setups.
As far as I could find, perf and bpftool are the only users for this
feature?
Quentin
prev parent reply other threads:[~2023-04-14 16:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-14 10:36 No Name
2023-04-14 15:43 ` Nathan Chancellor
2023-04-14 16:26 ` Quentin Monnet [this message]
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=c8168a87-7c98-caf9-5bf3-5779120b3121@isovalent.com \
--to=quentin@isovalent.com \
--cc=acme@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=xbjfk.github@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®