Skip to contentSkip to conversation

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

PATCH New [email protected] 1 participant 1 message Sep 15

lore
Share & tools
lore
#0 lore raw

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

From: Sunil Dora <[email protected]>

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]

---
 meta/recipes-devtools/git/git_2.55.0.bb | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-devtools/git/git_2.55.0.bb +3 -0
index ecb7a8e1d1..4535f94925 100644
@@ -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 () {
Signature · 1 line
2.43.0