package/linux-tools: hv: fix build on non-x86 build hosts
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
--- 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
@@ -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
Thomas Petazzoni via buildroot
AppliedQuoted 17 lines · Yegor Yefremov
Since Linux 5.4, commit
9b5434196529("Tools: hv: move to tools buildsystem"), the Hyper-V daemons are built withtools/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 supportedPass 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 usedtools/buildfor them, without passing LD. It therefore affects 2020.02 and later, including 2025.02.x.
Quoted 6 lines
Fixes:
https://autobuild.buildroot.org/results/86c33797a5f09dbb1162a554cb6019f7c0702fbdFixes 2703383c72011d38a1e3559cb7a5a2b0071b35c6 ("package/linux-tools: add hyperv integration services")Assisted-by Claude:claude-opus-5-5Signed-off-by Yegor Yefremov <[email protected]>
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
Thomas Petazzoni via buildroot
AppliedQuoted 17 lines · Yegor Yefremov
Since Linux 5.4, commit
9b5434196529("Tools: hv: move to tools buildsystem"), the Hyper-V daemons are built withtools/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 supportedPass 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 usedtools/buildfor them, without passing LD. It therefore affects 2020.02 and later, including 2025.02.x.
Quoted 6 lines
Fixes:
https://autobuild.buildroot.org/results/86c33797a5f09dbb1162a554cb6019f7c0702fbdFixes 2703383c72011d38a1e3559cb7a5a2b0071b35c6 ("package/linux-tools: add hyperv integration services")Assisted-by Claude:claude-opus-5-5Signed-off-by Yegor Yefremov <[email protected]>
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
Raphaël Mélotte via buildroot
AppliedIn reply of:
Quoted 17 lines
Since Linux 5.4, commit
9b5434196529("Tools: hv: move to tools buildsystem"), the Hyper-V daemons are built withtools/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 supportedPass 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 usedtools/buildfor them, without passing LD. It therefore affects 2020.02 and later, including 2025.02.x.
Quoted 6 lines
Fixes:
https://autobuild.buildroot.org/results/86c33797a5f09dbb1162a554cb6019f7c0702fbdFixes 2703383c72011d38a1e3559cb7a5a2b0071b35c6 ("package/linux-tools: add hyperv integration services")Assisted-by Claude:claude-opus-5-5Signed-off-by Yegor Yefremov <[email protected]>
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@@ -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
-1HV_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