aboutsummaryrefslogtreecommitdiff
path: root/libc/src
diff options
context:
space:
mode:
authorlntue <35648136+lntue@users.noreply.github.com>2024-06-17 16:56:19 -0400
committerGitHub <noreply@github.com>2024-06-17 16:56:19 -0400
commita50bcc03cbaecf6473c6bf41f4497758a7876f3d (patch)
treeb1ab2f4a578d8fd06433e2ab77c3babc09c4751d /libc/src
parent44ca65661e2cdd5636f592f573a2837e6ae948ba (diff)
downloadllvm-a50bcc03cbaecf6473c6bf41f4497758a7876f3d.zip
llvm-a50bcc03cbaecf6473c6bf41f4497758a7876f3d.tar.gz
llvm-a50bcc03cbaecf6473c6bf41f4497758a7876f3d.tar.bz2
[libc][stdlib] Only add internal malloc in full build mode. Use the system malloc in overlay mode. (#95845)
This causes an issue in overlay mode: https://github.com/llvm/llvm-project/pull/95736#issuecomment-2172739705
Diffstat (limited to 'libc/src')
-rw-r--r--libc/src/stdlib/CMakeLists.txt26
1 files changed, 17 insertions, 9 deletions
diff --git a/libc/src/stdlib/CMakeLists.txt b/libc/src/stdlib/CMakeLists.txt
index e26c19f..fdbf7b7 100644
--- a/libc/src/stdlib/CMakeLists.txt
+++ b/libc/src/stdlib/CMakeLists.txt
@@ -418,15 +418,23 @@ else()
libc.src.string.memory_utils.inline_memcpy
libc.src.string.memory_utils.inline_memset
)
- add_entrypoint_object(
- malloc
- SRCS
- freelist_malloc.cpp
- HDRS
- malloc.h
- DEPENDS
- .freelist_heap
- )
+ # Only add malloc in full build mode. Use the system malloc in overlay mode.
+ if(LLVM_LIBC_FULL_BUILD)
+ add_entrypoint_object(
+ malloc
+ SRCS
+ freelist_malloc.cpp
+ HDRS
+ malloc.h
+ DEPENDS
+ .freelist_heap
+ )
+ else()
+ add_entrypoint_external(
+ malloc
+ )
+ endif()
+
add_entrypoint_external(
free
)