Re: [PATCH 8/8] perf docs: Document building with Clang
From: Leo Yan
Date: Fri Sep 26 2025 - 11:41:40 EST
Hi Ian,
On Thu, Sep 25, 2025 at 12:43:55PM -0700, Ian Rogers wrote:
[...]
> > +5) Build with clang
> > +===================
> > +By default, the makefile uses GCC as compiler. With specifying environment
> > +variables HOSTCC, CC and CXX, it allows to build perf with clang.
> > +
> > +Using clang for native build:
> > +
> > + $ HOSTCC=clang CC=clang CXX=clang++ make -C tools/perf
> > +
> > +Using clang for cross compilation:
> > +
> > + $ HOSTCC=clang CC=clang CXX=clang++ \
> > + make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -C tools/perf \
> > + NO_LIBELF=1 NO_LIBTRACEEVENT=1 NO_JEVENTS=1
>
> The three NO_-s here are going to cripple the build quite a lot, I
> wonder if we can list package dependencies to install and failing that
> use the NO_-s.
In the next version, I will drop NO_ options to avoid confusing.
Missing libraries can occur in both native build and cross build, so
this is not a specific issue for cross build. OTOH, the build logs
already provide clear reminders, here no need to bother readers for
these NO_ options.
> > +
> > +In the example above, due to lack libelf, python and libtraceevent for
> > +cross comiplation, disable the features accordingly.
>
> nit: s/comiplation/compilation/
>
> > diff --git a/tools/perf/Documentation/android.txt b/tools/perf/Documentation/android.txt
> > index 24a59998fc91e814ad96f658d3481d88d798b60c..e65204cf2921f6bd8a79875784c5b3d5487ce05d 100644
> > --- a/tools/perf/Documentation/android.txt
> > +++ b/tools/perf/Documentation/android.txt
> > @@ -1,78 +1,12 @@
> > How to compile perf for Android
> > -=========================================
> > +===============================
> >
> > -I. Set the Android NDK environment
> > -------------------------------------------------
> > +There have two ways to build perf and run it on Android.
>
> nit: s/There have/There are/
Will do. Thanks a lot for review!
Leo