File tree Expand file tree Collapse file tree 7 files changed +27
-39
lines changed Expand file tree Collapse file tree 7 files changed +27
-39
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,9 @@ add_object_library(
5656 freelist_heap.h
5757 DEPENDS
5858 .block
59+ .freelist
5960 .freestore
61+ .freetrie
6062 libc.src.__support.CPP.cstddef
6163 libc.src.__support.CPP.array
6264 libc.src.__support.CPP.optional
Original file line number Diff line number Diff line change @@ -387,6 +387,25 @@ if(LLVM_LIBC_INCLUDE_SCUDO)
387387 DEPENDS
388388 ${SCUDO_DEPS}
389389 )
390+ elseif (NOT LIBC_TARGET_OS_IS_BAREMETAL AND NOT LIBC_TARGET_OS_IS_GPU)
391+ add_entrypoint_external(
392+ malloc
393+ )
394+ add_entrypoint_external(
395+ calloc
396+ )
397+ add_entrypoint_external(
398+ realloc
399+ )
400+ add_entrypoint_external(
401+ aligned_alloc
402+ )
403+ add_entrypoint_external(
404+ free
405+ )
406+ add_entrypoint_external(
407+ mallopt
408+ )
390409endif ()
391410
392411if (NOT LLVM_LIBC_FULL_BUILD)
@@ -474,40 +493,7 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_OS})
474493 add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /${LIBC_TARGET_OS} )
475494endif ()
476495
477- if (LIBC_TARGET_OS_IS_BAREMETAL)
478- add_entrypoint_object(
479- malloc
480- ALIAS
481- DEPENDS
482- .${LIBC_TARGET_OS} .malloc
483- )
484- add_entrypoint_object(
485- free
486- ALIAS
487- DEPENDS
488- .${LIBC_TARGET_OS} .free
489- )
490- add_entrypoint_object(
491- calloc
492- ALIAS
493- DEPENDS
494- .${LIBC_TARGET_OS} .calloc
495- )
496- add_entrypoint_object(
497- realloc
498- ALIAS
499- DEPENDS
500- .${LIBC_TARGET_OS} .realloc
501- )
502- add_entrypoint_object(
503- aligned_alloc
504- ALIAS
505- DEPENDS
506- .${LIBC_TARGET_OS} .aligned_alloc
507- )
508- endif ()
509-
510- if (LIBC_TARGET_OS_IS_GPU)
496+ if (LIBC_TARGET_OS_IS_BAREMETAL OR LIBC_TARGET_OS_IS_GPU)
511497 add_entrypoint_object(
512498 malloc
513499 ALIAS
Original file line number Diff line number Diff line change 66//
77// ===----------------------------------------------------------------------===//
88
9+ #include " src/stdlib/aligned_alloc.h"
910#include " src/__support/freelist_heap.h"
1011#include " src/__support/macros/config.h"
11- #include " src/stdlib/aligned_alloc.h"
1212
1313#include < stddef.h>
1414
Original file line number Diff line number Diff line change 66//
77// ===----------------------------------------------------------------------===//
88
9+ #include " src/stdlib/calloc.h"
910#include " src/__support/freelist_heap.h"
1011#include " src/__support/macros/config.h"
11- #include " src/stdlib/calloc.h"
1212
1313#include < stddef.h>
1414
Original file line number Diff line number Diff line change 66//
77// ===----------------------------------------------------------------------===//
88
9+ #include " src/stdlib/free.h"
910#include " src/__support/freelist_heap.h"
1011#include " src/__support/macros/config.h"
11- #include " src/stdlib/free.h"
1212
1313#include < stddef.h>
1414
Original file line number Diff line number Diff line change 66//
77// ===----------------------------------------------------------------------===//
88
9+ #include " src/stdlib/malloc.h"
910#include " src/__support/freelist_heap.h"
1011#include " src/__support/macros/config.h"
11- #include " src/stdlib/malloc.h"
1212
1313#include < stddef.h>
1414
Original file line number Diff line number Diff line change 66//
77// ===----------------------------------------------------------------------===//
88
9+ #include " src/stdlib/realloc.h"
910#include " src/__support/freelist_heap.h"
1011#include " src/__support/macros/config.h"
11- #include " src/stdlib/realloc.h"
1212
1313#include < stddef.h>
1414
You can’t perform that action at this time.
0 commit comments