Skip to content

Commit ad04ace

Browse files
committed
Fixes
1 parent ad6482b commit ad04ace

File tree

7 files changed

+27
-39
lines changed

7 files changed

+27
-39
lines changed

libc/src/__support/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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

libc/src/stdlib/CMakeLists.txt

Lines changed: 20 additions & 34 deletions
Original file line numberDiff line numberDiff 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+
)
390409
endif()
391410

392411
if(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})
475494
endif()
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

libc/src/stdlib/baremetal/aligned_alloc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
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

libc/src/stdlib/baremetal/calloc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
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

libc/src/stdlib/baremetal/free.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
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

libc/src/stdlib/baremetal/malloc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
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

libc/src/stdlib/baremetal/realloc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
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

0 commit comments

Comments
 (0)