lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z0cIVfgdU5XDoa7g@krava>
Date: Wed, 27 Nov 2024 12:53:57 +0100
From: Jiri Olsa <olsajiri@...il.com>
To: Björn Töpel <bjorn@...nel.org>
Cc: bpf@...r.kernel.org, linux-perf-users@...r.kernel.org,
	Alexandre Ghiti <alexghiti@...osinc.com>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Jean-Philippe Brucker <jean-philippe@...aro.org>,
	Quentin Monnet <qmo@...nel.org>,
	Andrii Nakryiko <andrii.nakryiko@...il.com>,
	Björn Töpel <bjorn@...osinc.com>,
	Paul Walmsley <paul.walmsley@...ive.com>,
	Palmer Dabbelt <palmer@...belt.com>,
	Albert Ou <aou@...s.berkeley.edu>, linux-riscv@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	David Abdurachmanov <davidlt@...osinc.com>,
	Namhyung Kim <namhyung@...nel.org>
Subject: Re: [PATCH bpf v2] tools: Override makefile ARCH variable if
 defined, but empty

On Wed, Nov 27, 2024 at 11:17:46AM +0100, Björn Töpel wrote:
> From: Björn Töpel <bjorn@...osinc.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@...aro.org>
> Tested-by: Alexandre Ghiti <alexghiti@...osinc.com>
> Reviewed-by: Namhyung Kim <namhyung@...nel.org>
> Acked-by: Quentin Monnet <qmo@...nel.org>
> Signed-off-by: Björn Töpel <bjorn@...osinc.com>

Acked-by: Jiri Olsa <jolsa@...nel.org>

jirka

> ---
> v2: Proper tree tag "bpf".
>     Collected *-by tags.
> 
> Andrii,
> 
> Apologies for missing out the tree tag in the patch. Here's a respin,
> and thanks for routing it via the BPF tree.
> 
> 
> Björn
> 
> ---
>  tools/scripts/Makefile.arch | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/scripts/Makefile.arch b/tools/scripts/Makefile.arch
> index f6a50f06dfc4..eabfe9f411d9 100644
> --- a/tools/scripts/Makefile.arch
> +++ b/tools/scripts/Makefile.arch
> @@ -7,8 +7,8 @@ HOSTARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
>                                    -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \
>                                    -e s/riscv.*/riscv/ -e s/loongarch.*/loongarch/)
>  
> -ifndef ARCH
> -ARCH := $(HOSTARCH)
> +ifeq ($(strip $(ARCH)),)
> +override ARCH := $(HOSTARCH)
>  endif
>  
>  SRCARCH := $(ARCH)
> 
> base-commit: 3448ad23b34e43a2526bd0f9e1221e8de876adec
> -- 
> 2.45.2
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ