diff mbox series

git: set HOST_CPU to avoid the build host arch in the binary

Message ID 20260915103959.3632620-1-sunilkumar.dora@windriver.com
State New
Headers show
Series git: set HOST_CPU to avoid the build host arch in the binary | expand

Commit Message

Dora, Sunil Kumar Sept. 15, 2026, 10:39 a.m. UTC
From: Sunil Dora <sunilkumar.dora@windriver.com>

git's Makefile falls back to `uname -m` when HOST_CPU is not set and bakes
the result into the binary as GIT_HOST_CPU. git and git-dbg then differ
between x86 and arm build hosts. TARGET_ARCH is the right value here for
target, native and nativesdk.

[YOCTO #16376]

Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
---
 meta/recipes-devtools/git/git_2.55.0.bb | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/meta/recipes-devtools/git/git_2.55.0.bb b/meta/recipes-devtools/git/git_2.55.0.bb
index ecb7a8e1d1..4535f94925 100644
--- a/meta/recipes-devtools/git/git_2.55.0.bb
+++ b/meta/recipes-devtools/git/git_2.55.0.bb
@@ -53,6 +53,9 @@  inherit upstream-stable-release-point
 EXTRA_OEMAKE = "NO_RUST=1 NO_PYTHON=1 CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'"
 EXTRA_OEMAKE += "'PERL_PATH=/usr/bin/env perl'"
 EXTRA_OEMAKE += "COMPUTE_HEADER_DEPENDENCIES=no"
+# git's Makefile falls back to uname -m for HOST_CPU and bakes the result
+# into the binary, which makes git differ between x86 and arm build hosts.
+EXTRA_OEMAKE += "HOST_CPU=${TARGET_ARCH}"
 EXTRA_OEMAKE:append:class-native = " NO_CROSS_DIRECTORY_HARDLINKS=1"
 
 do_compile:prepend () {