Skip to content

Commit a50bcc0

Browse files
authored
[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: #95736 (comment)
1 parent 44ca656 commit a50bcc0

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

libc/src/stdlib/CMakeLists.txt

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -418,15 +418,23 @@ else()
418418
libc.src.string.memory_utils.inline_memcpy
419419
libc.src.string.memory_utils.inline_memset
420420
)
421-
add_entrypoint_object(
422-
malloc
423-
SRCS
424-
freelist_malloc.cpp
425-
HDRS
426-
malloc.h
427-
DEPENDS
428-
.freelist_heap
429-
)
421+
# Only add malloc in full build mode. Use the system malloc in overlay mode.
422+
if(LLVM_LIBC_FULL_BUILD)
423+
add_entrypoint_object(
424+
malloc
425+
SRCS
426+
freelist_malloc.cpp
427+
HDRS
428+
malloc.h
429+
DEPENDS
430+
.freelist_heap
431+
)
432+
else()
433+
add_entrypoint_external(
434+
malloc
435+
)
436+
endif()
437+
430438
add_entrypoint_external(
431439
free
432440
)

0 commit comments

Comments
 (0)