On Thu, Oct 29, 2020 at 11:05 AM 'Fangrui Song' via Clang Built Linux <clang-built-linux@xxxxxxxxxxxxxxxx> wrote: > > Commit 393f203f5fd5 ("x86_64: kasan: add interceptors for > memset/memmove/memcpy functions") added .weak directives to > arch/x86/lib/mem*_64.S instead of changing the existing SYM_FUNC_START_* > macros. This can lead to the assembly snippet `.weak memcpy ... .globl > memcpy` which will produce a STB_WEAK memcpy with GNU as but STB_GLOBAL > memcpy with LLVM's integrated assembler before LLVM 12. LLVM 12 (since > https://reviews.llvm.org/D90108) will error on such an overridden symbol > binding. > > Use the appropriate SYM_FUNC_START_WEAK instead. > > Fixes: 393f203f5fd5 ("x86_64: kasan: add interceptors for memset/memmove/memcpy functions") > Reported-by: Sami Tolvanen <samitolvanen@xxxxxxxxxx> > Signed-off-by: Fangrui Song <maskray@xxxxxxxxxx> > Cc: <stable@xxxxxxxxxxxxxxx> > --- > arch/x86/lib/memcpy_64.S | 4 +--- > arch/x86/lib/memmove_64.S | 4 +--- > arch/x86/lib/memset_64.S | 4 +--- > 3 files changed, 3 insertions(+), 9 deletions(-) Thank you for fixing this! I tested the patch with gcc 9.3 and clang 12, both with and without Clang's integrated assembler, and the kernel builds and boots with all compilers again. Tested-by: Sami Tolvanen <samitolvanen@xxxxxxxxxx> Sami