Skip to content

Commit

Permalink
[libc][obvious] add aligned_alloc as entrypoint
Browse files Browse the repository at this point in the history
This patch adds aligned_alloc as an entrypoint. Previously it was being
included implicitly.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D122362
  • Loading branch information
michaelrj-google committed Mar 23, 2022
1 parent b0dc2fa commit 6d0f5d9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions libc/config/linux/x86_64/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.stdlib.malloc
libc.src.stdlib.calloc
libc.src.stdlib.realloc
libc.src.stdlib.aligned_alloc
libc.src.stdlib.free

# sys/mman.h entrypoints
Expand Down
1 change: 1 addition & 0 deletions libc/spec/stdc.td
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ def StdC : StandardSpec<"stdc"> {
FunctionSpec<"malloc", RetValSpec<VoidPtr>, [ArgSpec<SizeTType>]>,
FunctionSpec<"calloc", RetValSpec<VoidPtr>, [ArgSpec<SizeTType>, ArgSpec<SizeTType>]>,
FunctionSpec<"realloc", RetValSpec<VoidPtr>, [ArgSpec<VoidPtr>, ArgSpec<SizeTType>]>,
FunctionSpec<"aligned_alloc", RetValSpec<VoidPtr>, [ArgSpec<SizeTType>, ArgSpec<SizeTType>]>,
FunctionSpec<"free", RetValSpec<VoidType>, [ArgSpec<VoidPtr>]>,

FunctionSpec<"_Exit", RetValSpec<NoReturn>, [ArgSpec<IntType>]>,
Expand Down
8 changes: 8 additions & 0 deletions libc/src/stdlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,11 @@ if(LLVM_LIBC_INCLUDE_SCUDO)
DEPENDS
${SCUDO_DEPS}
)
add_entrypoint_external(
aligned_alloc
DEPENDS
${SCUDO_DEPS}
)
add_entrypoint_external(
free
DEPENDS
Expand All @@ -249,6 +254,9 @@ else()
add_entrypoint_external(
realloc
)
add_entrypoint_external(
aligned_alloc
)
add_entrypoint_external(
free
)
Expand Down
1 change: 1 addition & 0 deletions libc/test/integration/scudo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ add_entrypoint_library(
libc.src.stdlib.malloc
libc.src.stdlib.calloc
libc.src.stdlib.realloc
libc.src.stdlib.aligned_alloc
libc.src.stdlib.free
)

Expand Down

0 comments on commit 6d0f5d9

Please sign in to comment.