From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Quentin Monnet <qmo@kernel.org>
Cc: James Clark <james.clark@linaro.org>,
linux-perf-users@vger.kernel.org, sesse@google.com,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Namhyung Kim <namhyung@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
"Liang, Kan" <kan.liang@linux.intel.com>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
"Masami Hiramatsu (Google)" <mhiramat@kernel.org>,
Changbin Du <changbin.du@huawei.com>,
Guilherme Amadio <amadio@gentoo.org>, Leo Yan <leo.yan@arm.com>,
Manu Bretelle <chantr4@gmail.com>,
linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
llvm@lists.linux.dev
Subject: Re: [PATCH 1/2] perf build: Autodetect minimum required llvm-dev version
Date: Tue, 10 Sep 2024 11:43:15 -0300 [thread overview]
Message-ID: <ZuBbAw2jbMwH91Az@x1> (raw)
In-Reply-To: <b2e813c4-be89-457d-8c38-38849177ec93@kernel.org>
On Tue, Sep 10, 2024 at 03:27:16PM +0100, Quentin Monnet wrote:
> 2024-09-10 15:04 UTC+0100 ~ James Clark <james.clark@linaro.org>
> > The new LLVM addr2line feature requires a minimum version of 13 to
> > compile. Add a feature check for the version so that NO_LLVM=1 doesn't
> > need to be explicitly added. Leave the existing llvm feature check
> > intact because it's used by tools other than Perf.
> >
> > This fixes the following compilation error when the llvm-dev version
> > doesn't match:
> >
> > util/llvm-c-helpers.cpp: In function 'char* llvm_name_for_code(dso*, const char*, u64)':
> > util/llvm-c-helpers.cpp:178:21: error: 'std::remove_reference_t<llvm::DILineInfo>' {aka 'struct llvm::DILineInfo'} has no member named 'StartAddress'
> > 178 | addr, res_or_err->StartAddress ? *res_or_err->StartAddress : 0);
> >
> > Fixes: c3f8644c21df ("perf report: Support LLVM for addr2line()")
> > Signed-off-by: James Clark <james.clark@linaro.org>
> > ---
> > tools/build/Makefile.feature | 2 +-
> > tools/build/feature/Makefile | 9 +++++++++
> > tools/build/feature/test-llvm-perf.cpp | 14 ++++++++++++++
> > tools/perf/Makefile.config | 6 +++---
> > 4 files changed, 27 insertions(+), 4 deletions(-)
> > create mode 100644 tools/build/feature/test-llvm-perf.cpp
> >
> > diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
> > index 0717e96d6a0e..427a9389e26c 100644
> > --- a/tools/build/Makefile.feature
> > +++ b/tools/build/Makefile.feature
> > @@ -136,7 +136,7 @@ FEATURE_DISPLAY ?= \
> > libunwind \
> > libdw-dwarf-unwind \
> > libcapstone \
> > - llvm \
> > + llvm-perf \
> Hi! Just a quick question, why remove "llvm" from the list, here?
Right, having it here is still interesting, if not for perf, for some
other tool in tools/ that uses this:
⬢[acme@toolbox perf-tools-next]$ cat tools/build/feature/test-llvm.cpp
// SPDX-License-Identifier: GPL-2.0
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/raw_ostream.h"
#define NUM_VERSION (((LLVM_VERSION_MAJOR) << 16) + (LLVM_VERSION_MINOR << 8) + LLVM_VERSION_PATCH)
#if NUM_VERSION < 0x030900
# error "LLVM version too low"
#endif
int main()
{
llvm::errs() << "Hello World!\n";
llvm::llvm_shutdown();
return 0;
}
⬢[acme@toolbox perf-tools-next]$
My understanding about James intention is that for perf we need at least
llvm-dev 13, but he kept the other feature test for other projects.
From Quentin, since this is in tools/build/Makefile.feature, so not perf
specific, maybe it should be somewhere else?
But keeping both in FEATURE_DISPLAY at tools/build/Makefile.feature
may be confusing?
- Arnaldo
next prev parent reply other threads:[~2024-09-10 14:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-10 14:04 [PATCH 1/2] perf build: Autodetect minimum required llvm-dev version James Clark
2024-09-10 14:04 ` [PATCH 2/2] perf build: Remove unused feature test target James Clark
2024-09-10 14:27 ` [PATCH 1/2] perf build: Autodetect minimum required llvm-dev version Quentin Monnet
2024-09-10 14:43 ` Arnaldo Carvalho de Melo [this message]
2024-09-10 15:11 ` James Clark
2024-09-10 16:53 ` Quentin Monnet
2024-09-10 19:06 ` Arnaldo Carvalho de Melo
2024-09-10 14:38 ` Arnaldo Carvalho de Melo
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=ZuBbAw2jbMwH91Az@x1 \
--to=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=amadio@gentoo.org \
--cc=bpf@vger.kernel.org \
--cc=changbin.du@huawei.com \
--cc=chantr4@gmail.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=justinstitt@google.com \
--cc=kan.liang@linux.intel.com \
--cc=leo.yan@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mark.rutland@arm.com \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=morbo@google.com \
--cc=namhyung@kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=peterz@infradead.org \
--cc=qmo@kernel.org \
--cc=sesse@google.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;
as well as URLs for NNTP newsgroup(s).