Re: [PATCH] KVM: selftests: Override memmove() to prevent "magic" references to memcpy()

From: Sean Christopherson

Date: Fri Nov 13 2026 - 09:50:02 EST


On Tue, 10 Nov 2026 12:33:30 -0800, Sean Christopherson wrote:
> Override memmove() along with the other string operations to prevent the
> compiler from generating a reference to the built-in memcpy() when using
> musl as the libc with a static build, which utlimately results in an error
> during linking due to a duplicate memcpy symbol:
>
> ld.lld: error: duplicate symbol: memcpy
> >>> defined at string_override.c:23 (lib/string_override.c:23)
> >>> $BUILD/build/selftests/c/lib/string_override.o:(memcpy)
> >>> defined at memcpy.lo:(.text+0x0) in archive $BUILD/build/musl/lib/libc.a
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> make: *** [Makefile.kvm:382: $BUILD/build/selftests/c/demand_paging_test] Error 1
>
> [...]

Applied to kvm-x86 selftests, thanks!

[1/1] KVM: selftests: Override memmove() to prevent "magic" references to memcpy()
https://github.com/kvm-x86/linux/commit/5a588219fe45

--
https://github.com/kvm-x86/linux/tree/next