[libc-commits] [libc] [libc][stdlib] Only add internal malloc in full build mode. Use the system malloc in overlay mode. (PR #95845)
via libc-commits
libc-commits at lists.llvm.org
Mon Jun 17 13:50:06 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: None (lntue)
<details>
<summary>Changes</summary>
This causes an issue in overlay mode: https://github.com/llvm/llvm-project/pull/95736#issuecomment-2172739705
---
Full diff: https://github.com/llvm/llvm-project/pull/95845.diff
1 Files Affected:
- (modified) libc/src/stdlib/CMakeLists.txt (+17-9)
``````````diff
diff --git a/libc/src/stdlib/CMakeLists.txt b/libc/src/stdlib/CMakeLists.txt
index e26c19f03f5ab..fdbf7b75e72f4 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
)
``````````
</details>
https://github.com/llvm/llvm-project/pull/95845
More information about the libc-commits
mailing list