[libc-commits] [PATCH] D95504: [libc] Add redirected malloc using system-libc.

Cheng Wang via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Jan 27 03:39:23 PST 2021


cheng.w added inline comments.


================
Comment at: libc/cmake/modules/LLVMLibCTestRules.cmake:148-163
+  if(LIBC_UNITTEST_REDIRECTED)
+    find_library(
+      libc_redirectors
+      llvmlibc_redirectors
+      PATHS ${LIBC_BUILD_DIR}/lib
+    )
+    target_link_libraries(
----------------
Also tried here:
```
if(LIBC_UNITTEST_REDIRECTED)
#   find_library(
#     libc_redirectors
#     llvmlibc_redirectors
#     PATHS ${LIBC_BUILD_DIR}/lib
#   )
    target_link_libraries(
      ${fq_target_name}
      PRIVATE
#     ${libc_redirectors}
+     llvmlibc_redirectors
    )
    add_dependencies(
      ${fq_target_name}
      llvmlibc_redirectors
    )
endif()
```
But `malloc` unit test failed for passing `-nostdlib` below to linker. 
```
libc/cmake/modules/LLVMLibCLibraryRules.cmake, line: 142
target_link_libraries(
  ${target_name}
  -nostdlib -lc -lm
)
```
Would it work fine after the `TODO`(libc/cmake/modules/LLVMLibCLibraryRules.cmake,  line: 133) fixed? 




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95504



More information about the libc-commits mailing list