[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251015125504.GC109737@e132581.arm.com>
Date: Wed, 15 Oct 2025 13:55:04 +0100
From: Leo Yan <leo.yan@....com>
To: hupu <hupu.gm@...il.com>
Cc: Ian Rogers <irogers@...gle.com>, namhyung@...nel.org,
peterz@...radead.org, mingo@...hat.com, acme@...nel.org,
mark.rutland@....com, alexander.shishkin@...ux.intel.com,
jolsa@...nel.org, adrian.hunter@...el.com, nathan@...nel.org,
nick.desaulniers+lkml@...il.com, morbo@...gle.com,
justinstitt@...gle.com, linux-kernel@...r.kernel.org,
linux-perf-users@...r.kernel.org
Subject: Re: [RFC] perf build: Allow passing extra Clang flags via
EXTRA_CLANG_FLAGS
Hi,
On Wed, Oct 15, 2025 at 07:47:04PM +0800, hupu wrote:
[...]
> I hadn’t installed the packages you mentioned earlier, but after
> running the installation commands you provided, I was indeed able to
> successfully build perf.
Great!
> In fact, I’m currently working on creating an SDK package, which
> includes a cross-toolchain that I built myself using crosstool-NG. My
> initial idea was to install certain third-party libraries (such as the
> packages you mentioned) into the cross-toolchain’s sysroot directory.
> With this approach, even when developing on different host machines,
> we could simply specify the header search path (pointing to the
> cross-toolchain’s sysroot directory) during compilation, and the build
> should succeed without requiring any additional package installation
> on the system.
>
> Based on this, I think allowing users to extend some options via
> EXTRA_CLANG_FLAGS could be a flexible way to handle such cases.
> However, this is just my personal thought and might not be entirely
> correct, so I’d like to hear your advice.
In the end, it is up to your target.
- If you just want an enviornment for cross build (no matter arm64 or
other archs), my preference is to rely on multi-arch packages.
For example, you can install arm64 version's packages on a Ubuntu
x86_64 system. The benefit is you don't need to maintain any
toolchain/packages, all are prepared by distro. See [1] for details.
- If you are working on a build system (like buildroot or OpenEmbedded)
for releasing a SDK. In this case, I agree that we should include
headers and libs provided by the SDK.
Either way, I don't think EXTRA_CLANG_FLAGS is right thing to do, as
this flag is only for Clang and it does not cover any case for lib
linkage. For SDK case, please check if PKG_CONFIG_SYSROOT_DIR and
PKG_CONFIG_LIBDIR are helpful (The doc [2] records info for these
variables, but I never verified it).
Thanks,
Leo
[1] https://github.com/perfwiki/main/blob/main/docs/arm64-cross-compilation-dockerfile.md
[2] tools/perf/Documentation/Build.txt
Powered by blists - more mailing lists