[PATCH bpf v2] tools: Override makefile ARCH variable if defined, but empty

Toke Høiland-Jørgensen toke at redhat.com
Thu Nov 28 05:07:20 PST 2024


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")
> Reviewed-by: Jean-Philippe Brucker <jean-philippe at linaro.org>
> Tested-by: Alexandre Ghiti <alexghiti at rivosinc.com>
> Reviewed-by: Namhyung Kim <namhyung at kernel.org>
> Acked-by: Quentin Monnet <qmo at kernel.org>
> Signed-off-by: Björn Töpel <bjorn at rivosinc.com>

Reviewed-by: Toke Høiland-Jørgensen <toke at redhat.com>




More information about the linux-riscv mailing list