lkml.org 
[lkml]   [2022]   [Dec]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 09/14] KVM: selftests: Explicitly disable builtins for mem*() overrides
From
On 12/13/22 01:16, Sean Christopherson wrote:
> Explicitly disable the compiler's builtin memcmp(), memcpy(), and
> memset(). Because only lib/string_override.c is built with -ffreestanding,
> the compiler reserves the right to do what it wants and can try to link the
> non-freestanding code to its own crud.
>
> /usr/bin/x86_64-linux-gnu-ld: /lib/x86_64-linux-gnu/libc.a(memcmp.o): in function `memcmp_ifunc':
> (.text+0x0): multiple definition of `memcmp'; tools/testing/selftests/kvm/lib/string_override.o:
> tools/testing/selftests/kvm/lib/string_override.c:15: first defined here
> clang: error: linker command failed with exit code 1 (use -v to see invocation)

Hmm, that's weird though. I think it's an effect of ifunc and maybe
even a linker bug. The patch makes sense anyway.

Paolo

\
 
 \ /
  Last update: 2023-03-26 23:19    [W:0.138 / U:0.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site