[libc-commits] [PATCH] D74397: [libc] Adding memcpy implementation for x86_64

Guillaume Chatelet via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Feb 28 07:30:15 PST 2020


gchatelet marked 3 inline comments as done.
gchatelet added a comment.

@sivachandra it seems there's a problem with the `NAME` attribute in `add_entrypoint_object` as the symbol being exported in the final library is not `memcpy` anymore but the provided `NAME`

   % nm /tmp/llvm-project_rel_compiled-with-clang/projects/libc/lib/libllvmlibc.a
  
  __errno_location.o:
  0000000000000000 T __errno_location
  0000000000000000 T _ZN11__llvm_libc16__errno_locationEv
  0000000000000000 b _ZN11__llvm_libcL7__errnoE
  
  strcpy.o:
                   U memcpy
  0000000000000000 T strcpy
                   U strlen
  0000000000000000 T _ZN11__llvm_libc6strcpyEPcPKc
  
  strcat.o:
  0000000000000000 T strcat
                   U strlen
  0000000000000000 T _ZN11__llvm_libc6strcatEPcPKc
                   U _ZN11__llvm_libc6strcpyEPcPKc
  
  memcpy.o:
  0000000000000000 A memcpy_x86_64_opt_avx512f
  0000000000000000 T _ZN11__llvm_libc25memcpy_x86_64_opt_avx512fEPvPKvm
  0000000000000000 T _ZN11__llvm_libc6memcpyEPvPKvm
  
  mmap.o:
  0000000000000000 T mmap
                   U _ZN11__llvm_libc16__errno_locationEv
  0000000000000000 T _ZN11__llvm_libc4mmapEPvmiiil
  
  munmap.o:
  0000000000000000 T munmap
                   U _ZN11__llvm_libc16__errno_locationEv
  0000000000000000 T _ZN11__llvm_libc6munmapEPvm
  
  raise.o:
  0000000000000000 T raise
  0000000000000000 T _ZN11__llvm_libc5raiseEi



================
Comment at: libc/cmake/modules/LLVMLibCRules.cmake:108
 #       DEPENDS <list of dependencies>
+#       COMPILE_OPTIONS <list of compile options>
+#       COMPILE_DEFINITIONS <list of compile definitions>
----------------
@sivachandra this should be submitted as a separate patch but it's better to have context for the change.


================
Comment at: libc/src/string/CMakeLists.txt:3
 
-# Checking that the raw object does not contain any undefined symbols.
-function(check_no_undefined_symbols target_name)
----------------
I'm removing this since all implementations will be tested from now on.


================
Comment at: libc/src/string/memcpy.cpp:15
+
+#ifdef DECLARE_LLVM_LIBC_ENTRYPOINT
+void *LLVM_LIBC_ENTRYPOINT(memcpy)(void *__restrict dst,
----------------
We need to selectively declare the entry point depending on if we generate test or final implementation.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74397/new/

https://reviews.llvm.org/D74397





More information about the libc-commits mailing list