diff --git a/compiler-rt/lib/memprof/tests/CMakeLists.txt b/compiler-rt/lib/memprof/tests/CMakeLists.txt --- a/compiler-rt/lib/memprof/tests/CMakeLists.txt +++ b/compiler-rt/lib/memprof/tests/CMakeLists.txt @@ -30,6 +30,10 @@ list(APPEND MEMPROF_UNITTEST_LINK_FLAGS -pthread) endif() +foreach(lib ${SANITIZER_TEST_CXX_LIBRARIES}) + list(APPEND MEMPROF_UNITTEST_LINK_FLAGS -l${lib}) +endforeach() + if(COMPILER_RT_DEFAULT_TARGET_ARCH IN_LIST MEMPROF_SUPPORTED_ARCH) # MemProf unit tests are only run on the host machine. set(arch ${COMPILER_RT_DEFAULT_TARGET_ARCH})