malloc, calloc, realloc, and free are all functions that other libc functions depend on, but are pulled from external sources, instead of having an internal implementation. This patch adds a way to include functions like that as entrypoints in the list of external entrypoints, and includes the malloc functions using this new path. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D112104
25 lines
569 B
CMake
25 lines
569 B
CMake
add_entrypoint_library(
|
|
llvmlibc
|
|
DEPENDS
|
|
${TARGET_LLVMLIBC_ENTRYPOINTS}
|
|
)
|
|
|
|
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR)
|
|
set(LIBC_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE})
|
|
else()
|
|
set(LIBC_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX})
|
|
endif()
|
|
|
|
install(
|
|
TARGETS llvmlibc
|
|
ARCHIVE DESTINATION "${LIBC_INSTALL_LIBRARY_DIR}"
|
|
COMPONENT llvmlibc
|
|
)
|
|
|
|
add_custom_target(
|
|
install-llvmlibc
|
|
DEPENDS llvmlibc
|
|
COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=llvmlibc
|
|
-P "${LIBC_BINARY_DIR}/cmake_install.cmake"
|
|
)
|