Skip to contentSkip to conversation

package/linux-tools: hv: fix build on non-x86 build hosts

PATCH Applied Yegor Yefremov 2 participants 4 messages Nov 4 – Nov 16

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/linux-tools: hv: fix build on non-x86 build hosts

Since Linux 5.4, commit 9b5434196529 ("Tools: hv: move to tools buildsystem"), the Hyper-V daemons are built with tools/build, which first links the objects with "$(LD) -r". We only pass CC to the hv build, so LD defaults to $(CROSS_COMPILE)ld, i.e. the build host's plain ld. That only works by chance on x86 build hosts, whose ld handles i386/x86_64 objects; on an aarch64 build host it fails:

LD hv_kvp_daemon-in.o
/usr/bin/ld.bfd: relocatable linking with relocations from format elf32-i386 (hv_kvp_daemon.o) to format elf64-littleaarch64 (hv_kvp_daemon-in.o) is not supported

Pass LD="$(TARGET_LD)", as already done for rtla.

This issue has been present since commit 2703383c7201 ("package/linux-tools:
add hyperv integration services"), which added the hv tools while the supported kernels already used tools/build for them, without passing LD. It therefore affects 2020.02 and later, including 2025.02.x.

Fixes:
https://autobuild.buildroot.org/results/86c33797a5f09dbb1162a554cb6019f7c0702fbd

Fixes 2703383c72011d38a1e3559cb7a5a2b0071b35c6 ("package/linux-tools: add hyperv integration services")
Assisted-by Claude:claude-opus-5-5
---
 package/linux-tools/linux-tool-hv.mk.in | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
package/linux-tools/linux-tool-hv.mk.in +4 -1
index e638fecfc6..3aead40178 100644
@@ -16,7 +16,10 @@ HV_hv_kvp_daemon = hypervkvpd
 HV_hv_fcopy_daemon = hypervfcopyd
 HV_hv_vss_daemon = hypervvssd
 
-HV_MAKE_OPTS = CC="$(TARGET_CC)" CFLAGS="$(filter-out -g%,$(TARGET_CFLAGS))"
+HV_MAKE_OPTS = \
+	CC="$(TARGET_CC)" \
+	LD="$(TARGET_LD)" \
+	CFLAGS="$(filter-out -g%,$(TARGET_CFLAGS))"
 
 define HV_BUILD_CMDS
 	$(Q)for prog in $(HV_PROGS_y); do \
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 17 lines · Yegor Yefremov

Since Linux 5.4, commit 9b5434196529 ("Tools: hv: move to tools buildsystem"), the Hyper-V daemons are built with tools/build, which first links the objects with "$(LD) -r". We only pass CC to the hv build, so LD defaults to $(CROSS_COMPILE)ld, i.e. the build host's plain ld. That only works by chance on x86 build hosts, whose ld handles i386/x86_64 objects; on an aarch64 build host it fails:

LD hv_kvp_daemon-in.o
/usr/bin/ld.bfd: relocatable linking with relocations from format elf32-i386 (hv_kvp_daemon.o) to format elf64-littleaarch64 (hv_kvp_daemon-in.o) is not supported

Pass LD="$(TARGET_LD)", as already done for rtla.

This issue has been present since commit 2703383c7201 ("package/linux-tools:
add hyperv integration services"), which added the hv tools while the supported kernels already used tools/build for them, without passing LD. It therefore affects 2020.02 and later, including 2025.02.x.

Quoted 6 lines

Fixes:
https://autobuild.buildroot.org/results/86c33797a5f09dbb1162a554cb6019f7c0702fbd

Fixes 2703383c72011d38a1e3559cb7a5a2b0071b35c6 ("package/linux-tools: add hyperv integration services")
Assisted-by Claude:claude-opus-5-5

Applied to master, thanks!

Best regards,

Thomas Petazzoni

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
In reply to Yegor Yefremov
Quoted 17 lines · Yegor Yefremov

Since Linux 5.4, commit 9b5434196529 ("Tools: hv: move to tools buildsystem"), the Hyper-V daemons are built with tools/build, which first links the objects with "$(LD) -r". We only pass CC to the hv build, so LD defaults to $(CROSS_COMPILE)ld, i.e. the build host's plain ld. That only works by chance on x86 build hosts, whose ld handles i386/x86_64 objects; on an aarch64 build host it fails:

LD hv_kvp_daemon-in.o
/usr/bin/ld.bfd: relocatable linking with relocations from format elf32-i386 (hv_kvp_daemon.o) to format elf64-littleaarch64 (hv_kvp_daemon-in.o) is not supported

Pass LD="$(TARGET_LD)", as already done for rtla.

This issue has been present since commit 2703383c7201 ("package/linux-tools:
add hyperv integration services"), which added the hv tools while the supported kernels already used tools/build for them, without passing LD. It therefore affects 2020.02 and later, including 2025.02.x.

Quoted 6 lines

Fixes:
https://autobuild.buildroot.org/results/86c33797a5f09dbb1162a554cb6019f7c0702fbd

Fixes 2703383c72011d38a1e3559cb7a5a2b0071b35c6 ("package/linux-tools: add hyperv integration services")
Assisted-by Claude:claude-opus-5-5

Applied to master, thanks!

Best regards,

Thomas Petazzoni

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw
In reply to Yegor Yefremov

In reply of:

Quoted 17 lines

Since Linux 5.4, commit 9b5434196529 ("Tools: hv: move to tools buildsystem"), the Hyper-V daemons are built with tools/build, which first links the objects with "$(LD) -r". We only pass CC to the hv build, so LD defaults to $(CROSS_COMPILE)ld, i.e. the build host's plain ld. That only works by chance on x86 build hosts, whose ld handles i386/x86_64 objects; on an aarch64 build host it fails:

LD hv_kvp_daemon-in.o
/usr/bin/ld.bfd: relocatable linking with relocations from format elf32-i386 (hv_kvp_daemon.o) to format elf64-littleaarch64 (hv_kvp_daemon-in.o) is not supported

Pass LD="$(TARGET_LD)", as already done for rtla.

This issue has been present since commit 2703383c7201 ("package/linux-tools:
add hyperv integration services"), which added the hv tools while the supported kernels already used tools/build for them, without passing LD. It therefore affects 2020.02 and later, including 2025.02.x.

Quoted 6 lines

Fixes:
https://autobuild.buildroot.org/results/86c33797a5f09dbb1162a554cb6019f7c0702fbd

Fixes 2703383c72011d38a1e3559cb7a5a2b0071b35c6 ("package/linux-tools: add hyperv integration services")
Assisted-by Claude:claude-opus-5-5

Applied to 2025.02.x, 2026.08.x. Thanks

Quoted 10 lines
---
 package/linux-tools/linux-tool-hv.mk.in | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
package/linux-tools/linux-tool-hv.mk.in +0 -0
index e638fecfc6..3aead40178 100644
@@ -16,7 +16,10 @@ HV_hv_kvp_daemon = hypervkvpd
 HV_hv_fcopy_daemon = hypervfcopyd

package/linux-tools/linux-tool-hv.mk.in HV_hv_kvp_daemon = hypervkvpd · line 25

Quoted 10 lines
package/linux-tools/linux-tool-hv.mk.in +4 -1
 HV_hv_vss_daemon = hypervvssd
 
-HV_MAKE_OPTS = CC="$(TARGET_CC)" CFLAGS="$(filter-out -g%,$(TARGET_CFLAGS))"
+HV_MAKE_OPTS = \
+	CC="$(TARGET_CC)" \
+	LD="$(TARGET_LD)" \
+	CFLAGS="$(filter-out -g%,$(TARGET_CFLAGS))"
 
 define HV_BUILD_CMDS
 	$(Q)for prog in $(HV_PROGS_y); do \

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot