<div dir="ltr">Hi,<div><br></div><div>I found that building LLVM in single-threaded mode with CMake is failing because some object files still have references to pthread routines. There are two instances of the build failure happening.</div>
<div><br></div><div>$ cmake .../llvm/ -DLLVM_ENABLE_THREADS=0</div><div>$ make -j8 check-all</div><div><br></div><div>% Linking CXX executable IRTests<br></div><div><div>../../lib/libgtest.a(gtest.cc.o): In function `testing::internal::ThreadLocal<testing::TestPartResultReporterInterface*>::~ThreadLocal()':</div>
<div>gtest.cc:(.text._ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED2Ev[_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED5Ev]+0x15): undefined reference to `pthread_getspecific'</div>
</div><div><br></div><div>% Linking CXX executable SupportTests<br></div><div><div>CMakeFiles/SupportTests.dir/ManagedStatic.cpp.o: In function `(anonymous namespace)::Initialize_MultipleThreads_Test::TestBody()':</div>
<div>ManagedStatic.cpp:(.text+0x9a): undefined reference to `pthread_create'</div><div>ManagedStatic.cpp:(.text+0xb7): undefined reference to `pthread_create'</div><div>ManagedStatic.cpp:(.text+0xc8): undefined reference to `pthread_join'</div>
<div>ManagedStatic.cpp:(.text+0xd9): undefined reference to `pthread_join'</div><div><br></div><div style>I am attaching a patch which fixes the above mentioned failures. Could you please review the patch?</div><div style>
<br></div><div style>Thanks,</div><div style>Manish</div><div><br></div></div></div>