Manish Verma
2013-Jan-07 23:51 UTC
[LLVMdev] Build failure when building single threaded LLVM with CMake
Hi, 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. $ cmake .../llvm/ -DLLVM_ENABLE_THREADS=0 $ make -j8 check-all % Linking CXX executable IRTests ../../lib/libgtest.a(gtest.cc.o): In function `testing::internal::ThreadLocal<testing::TestPartResultReporterInterface*>::~ThreadLocal()': gtest.cc:(.text._ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED2Ev[_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED5Ev]+0x15): undefined reference to `pthread_getspecific' % Linking CXX executable SupportTests CMakeFiles/SupportTests.dir/ManagedStatic.cpp.o: In function `(anonymous namespace)::Initialize_MultipleThreads_Test::TestBody()': ManagedStatic.cpp:(.text+0x9a): undefined reference to `pthread_create' ManagedStatic.cpp:(.text+0xb7): undefined reference to `pthread_create' ManagedStatic.cpp:(.text+0xc8): undefined reference to `pthread_join' ManagedStatic.cpp:(.text+0xd9): undefined reference to `pthread_join' I am attaching a patch which fixes the above mentioned failures. Could you please review the patch? Thanks, Manish -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130107/9697707c/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Added-conditionalization-code-to-prevent-pulling-pth.patch Type: application/octet-stream Size: 1635 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130107/9697707c/attachment.obj>
Óscar Fuentes
2013-Jan-08 00:46 UTC
[LLVMdev] Build failure when building single threaded LLVM with CMake
Manish Verma <manish.avtaar at gmail.com> writes:> I am attaching a patch which fixes the above mentioned failures. Could you > please review the patch?[snip]> index 79eb098..6419653 100644 > --- a/unittests/Support/ManagedStatic.cpp > +++ b/unittests/Support/ManagedStatic.cpp > @@ -9,7 +9,7 @@ > #include "llvm/Support/ManagedStatic.h" > #include "llvm/Config/config.h" > #include "llvm/Support/Threading.h" > -#ifdef HAVE_PTHREAD_H > +#ifdef LLVM_ENABLE_THREADS !=0 && defined(HAVE_PTHREAD_H)Use #if instead of #ifdef> #include <pthread.h> > #endif > > @@ -19,7 +19,7 @@ using namespace llvm; > > namespace { > > -#ifdef HAVE_PTHREAD_H > +#ifdef LLVM_ENABLE_PTHREADS!=0 && defined(HAVE_PTHREAD_H)Same here. [snip]
Manish Verma
2013-Jan-08 07:22 UTC
[LLVMdev] Build failure when building single threaded LLVM with CMake
Hi, Thanks! An updated patch is attached. Manish On Tue, Jan 8, 2013 at 12:46 AM, Óscar Fuentes <ofv at wanadoo.es> wrote:> Manish Verma <manish.avtaar at gmail.com> writes: > > > I am attaching a patch which fixes the above mentioned failures. Could > you > > please review the patch? > > [snip] > > > index 79eb098..6419653 100644 > > --- a/unittests/Support/ManagedStatic.cpp > > +++ b/unittests/Support/ManagedStatic.cpp > > @@ -9,7 +9,7 @@ > > #include "llvm/Support/ManagedStatic.h" > > #include "llvm/Config/config.h" > > #include "llvm/Support/Threading.h" > > -#ifdef HAVE_PTHREAD_H > > +#ifdef LLVM_ENABLE_THREADS !=0 && defined(HAVE_PTHREAD_H) > > Use #if instead of #ifdef > > > #include <pthread.h> > > #endif > > > > @@ -19,7 +19,7 @@ using namespace llvm; > > > > namespace { > > > > -#ifdef HAVE_PTHREAD_H > > +#ifdef LLVM_ENABLE_PTHREADS!=0 && defined(HAVE_PTHREAD_H) > > Same here. > > [snip] > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130108/f2c9aeef/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-dded-conditionalization-code-to-prevent-pulling-pthr.patch Type: application/octet-stream Size: 1628 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130108/f2c9aeef/attachment.obj>
Apparently Analagous Threads
- [LLVMdev] Build failure when building single threaded LLVM with CMake
- [LLVMdev] Patch for Transform/LoopStrengthReduction/post-inc-icmpzero.ll test-failure
- [LLVMdev] Patch for Transform/LoopStrengthReduction/post-inc-icmpzero.ll test-failure
- [LLVMdev] CMake build maturity
- [LLVMdev] Patch for Transform/LoopStrengthReduction/post-inc-icmpzero.ll test-failure