Index: test/asan/lit.cfg =================================================================== --- test/asan/lit.cfg +++ test/asan/lit.cfg @@ -77,6 +77,9 @@ asan_dynamic_flags = [] if config.asan_dynamic: asan_dynamic_flags = ["-shared-libasan"] + # On FreeBSD, we need to add -pthread to ensure pthread functions are available. + if platform.system() == 'FreeBSD': + asan_dynamic_flags += ['-pthread'] # On Windows, we need to simulate "clang-cl /MD" on the clang driver side. if platform.system() == 'Windows': asan_dynamic_flags += ["-D_MT", "-D_DLL", "-Wl,-nodefaultlib:libcmt,-defaultlib:msvcrt,-defaultlib:oldnames"]