tools: Override makefile ARCH variable if defined, but empty
PATCH v2 1/1 tools: Override makefile ARCH variable if defined, but empty
From: Björn Töpel <[email protected]>
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.
---
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(-)
tools/scripts/Makefile.arch +2 -2
@@ -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
Signature · 1 line
2.45.2
Quoted 14 lines · Björn Töpel
From: Björn Töpel <[email protected]>
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.
Quoted 8 lines
Workaround by overriding ARCH to the host arch, if ARCH is empty.
Fixes 8859b0da5aac ("tools/bpftool: Fix cross-build")Reviewed-by Jean-Philippe Brucker <[email protected]>Tested-by Alexandre Ghiti <[email protected]>Reviewed-by Namhyung Kim <[email protected]>Acked-by Quentin Monnet <[email protected]>Signed-off-by Björn Töpel <[email protected]>
jirka
Quoted 37 lines
---
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(-)tools/scripts/Makefile.arch +2
-2@@ -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:
3448ad23b34e43a2526bd0f9e1221e8de876adecSignature · 1 line
2.45.2
Quoted 14 lines · Björn Töpel
From: Björn Töpel <[email protected]>
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.
Quoted 8 lines
Workaround by overriding ARCH to the host arch, if ARCH is empty.
Fixes 8859b0da5aac ("tools/bpftool: Fix cross-build")Reviewed-by Jean-Philippe Brucker <[email protected]>Tested-by Alexandre Ghiti <[email protected]>Reviewed-by Namhyung Kim <[email protected]>Acked-by Quentin Monnet <[email protected]>Signed-off-by Björn Töpel <[email protected]>
This patch was applied to bpf/bpf.git (master) by Daniel Borkmann <[email protected]>:
Hello:
This patch was applied to bpf/bpf.git (master)
by Daniel Borkmann <[email protected]>:
Quoted 11 lines · On Wed, 27 Nov 2024 11:17:46 +0100 you wrote:
From: Björn Töpel <[email protected]>
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.
Quoted 1 line
[...]
Here is the summary with links:
- [bpf,v2] tools: Override makefile ARCH variable if defined, but empty
https://git.kernel.org/bpf/bpf/c/537a2525eaf7
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
This patch was applied to riscv/linux.git (fixes) by Daniel Borkmann <[email protected]>:
Hello:
This patch was applied to riscv/linux.git (fixes)
by Daniel Borkmann <[email protected]>:
Quoted 11 lines · On Wed, 27 Nov 2024 11:17:46 +0100 you wrote:
From: Björn Töpel <[email protected]>
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.
Quoted 1 line
[...]
Here is the summary with links:
- [bpf,v2] tools: Override makefile ARCH variable if defined, but empty
https://git.kernel.org/riscv/c/537a2525eaf7
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html