[PATCH] tools: Override makefile ARCH variable if defined, but empty
Namhyung Kim
namhyung at kernel.org
Wed Nov 20 22:04:51 PST 2024
On Wed, Nov 20, 2024 at 02:25:22PM +0100, Björn Töpel wrote:
> Björn Töpel <bjorn at kernel.org> writes:
>
> > From: Björn Töpel <bjorn at rivosinc.com>
> >
> > There are a number of tools (bpftool, selftests), that require a
> > "bootstrap" build. Here, a bootstrap build is a build host variant of
> > a target. E.g., assume that you're performing a bpftool cross-build on
> > x86 to riscv, a bootstrap build would then be an x86 variant of
> > bpftool. The typical way to perform the host build variant, is to pass
> > "ARCH=" in a sub-make. However, if a variable has been set with a
> > command argument, then ordinary assignments in the makefile are
> > ignored.
> >
> > This side-effect results in that ARCH, and variables depending on ARCH
> > are not set.
> >
> > Workaround by overriding ARCH to the host arch, if ARCH is empty.
> >
> > Fixes: 8859b0da5aac ("tools/bpftool: Fix cross-build")
> > Signed-off-by: Björn Töpel <bjorn at rivosinc.com>
Reviewed-by: Namhyung Kim <namhyung at kernel.org>
>
> Arnaldo/Palmer/Quentin:
>
> A bit unsure what tree this patch should go. It's very important for the
> RISC-V builds, so maybe via Palmer's RISC-V tree?
I think it'd be best to route this through the bpf tree as it seems the
main target is bpftool. But given the size and the scope of the change,
it should be fine with perf-tools or RISC-V tree.
Thanks,
Namhyung
>
> Opinions? Just want to make sure it doesn't fall between any chairs!
> :-)
>
>
> Björn
More information about the linux-riscv
mailing list