diff --git a/libc/config/linux/aarch64/entrypoints.txt b/libc/config/linux/aarch64/entrypoints.txt --- a/libc/config/linux/aarch64/entrypoints.txt +++ b/libc/config/linux/aarch64/entrypoints.txt @@ -55,6 +55,10 @@ libc.src.string.strtok libc.src.string.strtok_r + # string.h entrypoints that depend on malloc + libc.src.string.strdup + libc.src.string.strndup + # inttypes.h entrypoints libc.src.inttypes.imaxdiv libc.src.inttypes.strtoimax @@ -81,6 +85,12 @@ libc.src.stdlib.strtoul libc.src.stdlib.strtoull + # stdlib.h external entrypoints + libc.src.stdlib.malloc + libc.src.stdlib.calloc + libc.src.stdlib.realloc + libc.src.stdlib.free + # sys/stat.h entrypoints libc.src.sys.stat.mkdir libc.src.sys.stat.mkdirat diff --git a/libc/config/linux/x86_64/entrypoints.txt b/libc/config/linux/x86_64/entrypoints.txt --- a/libc/config/linux/x86_64/entrypoints.txt +++ b/libc/config/linux/x86_64/entrypoints.txt @@ -55,6 +55,10 @@ libc.src.string.strtok libc.src.string.strtok_r + # string.h entrypoints that depend on malloc + libc.src.string.strdup + libc.src.string.strndup + # inttypes.h entrypoints libc.src.inttypes.imaxdiv libc.src.inttypes.strtoimax @@ -81,6 +85,12 @@ libc.src.stdlib.strtoul libc.src.stdlib.strtoull + # stdlib.h external entrypoints + libc.src.stdlib.malloc + libc.src.stdlib.calloc + libc.src.stdlib.realloc + libc.src.stdlib.free + # sys/mman.h entrypoints libc.src.sys.mman.mmap libc.src.sys.mman.munmap @@ -251,25 +261,6 @@ ) endif() -if(LLVM_LIBC_INCLUDE_SCUDO) - list(APPEND TARGET_LIBC_ENTRYPOINTS - - # stdlib.h external entrypoints - libc.src.stdlib.malloc - libc.src.stdlib.calloc - libc.src.stdlib.realloc - libc.src.stdlib.free - ) -endif() - -if(LLVM_LIBC_INCLUDE_SCUDO OR NOT LLVM_LIBC_FULL_BUILD) - list(APPEND TARGET_LIBC_ENTRYPOINTS - # string.h entrypoints that depend on malloc - libc.src.string.strdup - libc.src.string.strndup - ) -endif() - set(TARGET_LLVMLIBC_ENTRYPOINTS ${TARGET_LIBC_ENTRYPOINTS} ${TARGET_LIBM_ENTRYPOINTS} diff --git a/libc/src/__support/CPP/CMakeLists.txt b/libc/src/__support/CPP/CMakeLists.txt --- a/libc/src/__support/CPP/CMakeLists.txt +++ b/libc/src/__support/CPP/CMakeLists.txt @@ -12,12 +12,10 @@ TypeTraits.h ) -if(LLVM_LIBC_INCLUDE_SCUDO OR NOT LLVM_LIBC_FULL_BUILD) - add_header_library( - vector - HDRS - vector.h - DEPENDS - libc.include.stdlib - ) -endif() +add_header_library( + vector + HDRS + vector.h + DEPENDS + libc.include.stdlib +) diff --git a/libc/src/stdlib/CMakeLists.txt b/libc/src/stdlib/CMakeLists.txt --- a/libc/src/stdlib/CMakeLists.txt +++ b/libc/src/stdlib/CMakeLists.txt @@ -230,7 +230,19 @@ DEPENDS ${SCUDO_DEPS} ) - +else() + add_entrypoint_external( + malloc + ) + add_entrypoint_external( + calloc + ) + add_entrypoint_external( + realloc + ) + add_entrypoint_external( + free + ) endif() if(NOT LLVM_LIBC_FULL_BUILD) diff --git a/libc/test/utils/CPP/CMakeLists.txt b/libc/test/utils/CPP/CMakeLists.txt --- a/libc/test/utils/CPP/CMakeLists.txt +++ b/libc/test/utils/CPP/CMakeLists.txt @@ -40,14 +40,12 @@ libc.src.__support.CPP.standalone_cpp ) -if(LLVM_LIBC_INCLUDE_SCUDO OR NOT LLVM_LIBC_FULL_BUILD) - add_libc_unittest( - vector_test - SUITE - libc_cpp_utils_unittests - SRCS - vector_test.cpp - DEPENDS - libc.src.__support.CPP.vector - ) -endif() +add_libc_unittest( + vector_test + SUITE + libc_cpp_utils_unittests + SRCS + vector_test.cpp + DEPENDS + libc.src.__support.CPP.vector +)