diff --git a/libc/fuzzing/string/CMakeLists.txt b/libc/fuzzing/string/CMakeLists.txt --- a/libc/fuzzing/string/CMakeLists.txt +++ b/libc/fuzzing/string/CMakeLists.txt @@ -4,4 +4,5 @@ strcpy_fuzz.cpp DEPENDS strcpy + memcpy ) diff --git a/libc/src/string/CMakeLists.txt b/libc/src/string/CMakeLists.txt --- a/libc/src/string/CMakeLists.txt +++ b/libc/src/string/CMakeLists.txt @@ -19,6 +19,7 @@ strcpy.h DEPENDS string_h + memcpy ) # ------------------------------------------------------------------------------ diff --git a/libc/src/string/strcpy.cpp b/libc/src/string/strcpy.cpp --- a/libc/src/string/strcpy.cpp +++ b/libc/src/string/strcpy.cpp @@ -7,13 +7,15 @@ //===----------------------------------------------------------------------===// #include "src/string/strcpy.h" +#include "src/string/memcpy.h" #include "src/__support/common.h" namespace __llvm_libc { char *LLVM_LIBC_ENTRYPOINT(strcpy)(char *dest, const char *src) { - return reinterpret_cast(::memcpy(dest, src, ::strlen(src) + 1)); + return reinterpret_cast( + __llvm_libc::memcpy(dest, src, ::strlen(src) + 1)); } } // namespace __llvm_libc diff --git a/libc/test/src/string/CMakeLists.txt b/libc/test/src/string/CMakeLists.txt --- a/libc/test/src/string/CMakeLists.txt +++ b/libc/test/src/string/CMakeLists.txt @@ -11,6 +11,8 @@ DEPENDS strcat strcpy +# TODO (sivachandra): remove redundant deps. + memcpy ) add_libc_unittest( @@ -21,6 +23,8 @@ strcpy_test.cpp DEPENDS strcpy +# TODO (sivachandra): remove redundant deps. + memcpy ) # Tests all implementations of memcpy that can run on the host.