From fab84dcd0a5a38df8ce5d8996fd2d0c917f39ae3 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 25 Apr 2023 19:03:43 -0500 Subject: [PATCH] [libc] Enable the GPU build to build the UnitTest library The previous patch in D149216 allows us to use the internal `` include for the GPU build. However, we currently don't provide the memory functions so the header wasn't resolving them. This patch adds these as entrypoints. They don't cause any entrypoints to be emitted because they are not implemented, but they provide it in the header so that we can rely on the test's implementation of them. Depends on D149216 Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D149217 --- libc/config/gpu/entrypoints.txt | 5 +++++ libc/test/CMakeLists.txt | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libc/config/gpu/entrypoints.txt b/libc/config/gpu/entrypoints.txt index 5750fba..d42a554 100644 --- a/libc/config/gpu/entrypoints.txt +++ b/libc/config/gpu/entrypoints.txt @@ -57,6 +57,11 @@ set(TARGET_LIBC_ENTRYPOINTS # stdlib.h entrypoints libc.src.stdlib.atoi + # Only implemented in the test suite + libc.src.stdlib.malloc + libc.src.stdlib.realloc + libc.src.stdlib.free + # errno.h entrypoints libc.src.errno.errno ) diff --git a/libc/test/CMakeLists.txt b/libc/test/CMakeLists.txt index 333873a..ed6de64 100644 --- a/libc/test/CMakeLists.txt +++ b/libc/test/CMakeLists.txt @@ -6,9 +6,7 @@ add_dependencies(check-libc libc-unit-tests libc-hermetic-tests) add_custom_target(exhaustive-check-libc) add_custom_target(libc-long-running-tests) -if(NOT LIBC_TARGET_ARCHITECTURE_IS_GPU) - add_subdirectory(UnitTest) -endif() +add_subdirectory(UnitTest) add_header_library( errno_setter_matcher -- 2.7.4