[libc-commits] [PATCH] D122360: [libc] Link the SCUDO integration tests to a special entrypoint collection.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Mar 23 16:27:42 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG316f9fd63801: [libc] Link the SCUDO integration tests to a special entrypoint collection. (authored by sivachandra).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122360/new/

https://reviews.llvm.org/D122360

Files:
  libc/test/integration/scudo/CMakeLists.txt


Index: libc/test/integration/scudo/CMakeLists.txt
===================================================================
--- libc/test/integration/scudo/CMakeLists.txt
+++ libc/test/integration/scudo/CMakeLists.txt
@@ -2,6 +2,22 @@
   return()
 endif()
 
+# We use a special library consisting of only the SCUDO allocator
+# functions to link to the integration tests below. We could instead
+# link to libllvmlibc.a directly, but since libllvmlibc.a contains
+# functions which depend on the LLVM libc loader, the integration
+# test will have to link to the LLVM libc loader. LLVM libc's loader
+# is not complete enough to allow this. It is also desireable to
+# keep the dependencies as minimal as possible.
+add_entrypoint_library(
+  libc_for_scudo_integration_test
+  DEPENDS
+    libc.src.stdlib.malloc
+    libc.src.stdlib.calloc
+    libc.src.stdlib.realloc
+    libc.src.stdlib.free
+)
+
 add_executable(
   libc-scudo-integration-test
   integration_test.cpp
@@ -10,14 +26,12 @@
 target_link_options(
   libc-scudo-integration-test
   PRIVATE
-  # TODO: Uncomment "-nolibc" once llvm-libc is complete enough.
-  # "-nolibc"
   -pthreads
 )
 
 target_link_libraries(libc-scudo-integration-test
   PRIVATE
-  llvmlibc
+  libc_for_scudo_integration_test
 )
 
 add_executable(
@@ -28,14 +42,12 @@
 target_link_options(
   libc-gwp-asan-uaf-should-crash
   PRIVATE
-  # TODO: Uncomment "-nolibc" once llvm-libc is complete enough.
-  # "-nolibc"
   -pthreads
 )
 
 target_link_libraries(libc-gwp-asan-uaf-should-crash
   PRIVATE
-  llvmlibc
+  libc_for_scudo_integration_test
 )
 
 add_custom_command(TARGET libc-scudo-integration-test


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122360.417780.patch
Type: text/x-patch
Size: 1640 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20220323/d5ae1cba/attachment-0001.bin>


More information about the libc-commits mailing list