Skip to contentSkip to conversation

tools: hv: Fix cross-compilation

PATCH Applied Aditya Garg 2 participants 2 messages Apr 9 – Apr 14

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 tools: hv: Fix cross-compilation

Use the native ARCH only in case it is not set, this will allow the cross-compilation where ARCH is explicitly set.

Additionally, simplify the ARCH check to build the fcopy daemon only for x86 and x86_64.

---
Changes since v2:
- Handle the normalized ARCH=x86 value from the top-level kernel Makefile

Changes since v1:
- Dropped the info target printing CC, LD and ARCH

v2: https://lore.kernel.org/all/[email protected]/
v1: https://lore.kernel.org/all/[email protected]/

---
 tools/hv/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/hv/Makefile +2 -2
index 34ffcec264ab..016753f3dd7f 100644
@@ -2,7 +2,7 @@
 # Makefile for Hyper-V tools
 include ../scripts/Makefile.include
 
-ARCH := $(shell uname -m 2>/dev/null)
+ARCH ?= $(shell uname -m 2>/dev/null)
 sbindir ?= /usr/sbin
 libexecdir ?= /usr/libexec
 sharedstatedir ?= /var/lib
@@ -20,7 +20,7 @@ override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include
 override CFLAGS += -Wno-address-of-packed-member
 
 ALL_TARGETS := hv_kvp_daemon hv_vss_daemon
-ifneq ($(ARCH), aarch64)
+ifneq ($(filter x86_64 x86,$(ARCH)),)
 ALL_TARGETS += hv_fcopy_uio_daemon
 endif
 ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS))
Signature · 1 line
2.43.0
maintainer Applied
#1 lore raw
Quoted 6 lines · Aditya Garg

Use the native ARCH only in case it is not set, this will allow the cross-compilation where ARCH is explicitly set.

Additionally, simplify the ARCH check to build the fcopy daemon only for x86 and x86_64.

Quoted 7 lines

Applied. Thanks.