[libc-commits] [libc] 6d0f5d9 - [libc][obvious] add aligned_alloc as entrypoint

Michael Jones via libc-commits libc-commits at lists.llvm.org
Wed Mar 23 16:44:20 PDT 2022


Author: Michael Jones
Date: 2022-03-23T16:44:15-07:00
New Revision: 6d0f5d95ad4d005dccad3f94b1ac6941a3167939

URL: https://github.com/llvm/llvm-project/commit/6d0f5d95ad4d005dccad3f94b1ac6941a3167939
DIFF: https://github.com/llvm/llvm-project/commit/6d0f5d95ad4d005dccad3f94b1ac6941a3167939.diff

LOG: [libc][obvious] add aligned_alloc as entrypoint

This patch adds aligned_alloc as an entrypoint. Previously it was being
included implicitly.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D122362

Added: 
    

Modified: 
    libc/config/linux/x86_64/entrypoints.txt
    libc/spec/stdc.td
    libc/src/stdlib/CMakeLists.txt
    libc/test/integration/scudo/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libc/config/linux/x86_64/entrypoints.txt b/libc/config/linux/x86_64/entrypoints.txt
index 7ae253ab187f9..e83bddafb984c 100644
--- a/libc/config/linux/x86_64/entrypoints.txt
+++ b/libc/config/linux/x86_64/entrypoints.txt
@@ -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

diff  --git a/libc/spec/stdc.td b/libc/spec/stdc.td
index 653a8a14de37f..f7b377d7f70f1 100644
--- a/libc/spec/stdc.td
+++ b/libc/spec/stdc.td
@@ -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>]>,

diff  --git a/libc/src/stdlib/CMakeLists.txt b/libc/src/stdlib/CMakeLists.txt
index 9201c7f521281..3a4c5160dffde 100644
--- a/libc/src/stdlib/CMakeLists.txt
+++ b/libc/src/stdlib/CMakeLists.txt
@@ -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
@@ -249,6 +254,9 @@ else()
   add_entrypoint_external(
     realloc
   )
+  add_entrypoint_external(
+    aligned_alloc
+  )
   add_entrypoint_external(
     free
   )

diff  --git a/libc/test/integration/scudo/CMakeLists.txt b/libc/test/integration/scudo/CMakeLists.txt
index 98e039aaf5e01..2e90c8406e5fe 100644
--- a/libc/test/integration/scudo/CMakeLists.txt
+++ b/libc/test/integration/scudo/CMakeLists.txt
@@ -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
 )
 


        


More information about the libc-commits mailing list