[llvm-commits] [PATCH] Fix CMake check for pthread_mutex_lock
Eric Christopher
echristo at apple.com
Tue Aug 28 17:07:39 PDT 2012
On Aug 28, 2012, at 9:25 AM, Brad Smith <brad at comstyle.com> wrote:
> On Fri, Aug 24, 2012 at 06:50:31AM -0400, Brad Smith wrote:
>> On Sat, Aug 18, 2012 at 03:03:37AM -0400, Brad Smith wrote:
>>> The attached diff for the CMake build infrastructure fixes
>>> the check for pthead_mutex_lock. CMake is attempting to build
>>> a binary to check for the existence of the symbol but not
>>> linking in libpthread.
>>>
>>> /usr/bin/cc -O2 -pipe CMakeFiles/cmTryCompileExec2801244708.dir/CheckSymbolExists.c.o -o cmTryCompileExec2801244708 -lm -Wl,-rpath-link,/usr/X11R6/lib:/us
>>> r/local/lib
>>> CMakeFiles/cmTryCompileExec2801244708.dir/CheckSymbolExists.c.o(.text+0x6): In function `main':
>>> : undefined reference to `pthread_mutex_lock'
>>> collect2: ld returned 1 exit status
>>
>> ping.
>
> Anyone?
>
Looks reasonable, I've poked Chandler about it since cmake is his baby.
-eric
>>> Index: cmake/config-ix.cmake
>>> ===================================================================
>>> --- cmake/config-ix.cmake (revision 161828)
>>> +++ cmake/config-ix.cmake (working copy)
>>> @@ -87,6 +87,7 @@
>>> check_library_exists(pthread pthread_create "" HAVE_LIBPTHREAD)
>>> check_library_exists(pthread pthread_getspecific "" HAVE_PTHREAD_GETSPECIFIC)
>>> check_library_exists(pthread pthread_rwlock_init "" HAVE_PTHREAD_RWLOCK_INIT)
>>> + check_library_exists(pthread pthread_mutex_lock "" HAVE_PTHREAD_MUTEX_LOCK)
>>> check_library_exists(dl dlopen "" HAVE_LIBDL)
>>> endif()
>>>
>>> @@ -134,9 +135,6 @@
>>> check_symbol_exists(strcmp string.h HAVE_STRCMP)
>>> check_symbol_exists(strdup string.h HAVE_STRDUP)
>>> check_symbol_exists(strrchr string.h HAVE_STRRCHR)
>>> -if( NOT PURE_WINDOWS )
>>> - check_symbol_exists(pthread_mutex_lock pthread.h HAVE_PTHREAD_MUTEX_LOCK)
>>> -endif()
>>> check_symbol_exists(sbrk unistd.h HAVE_SBRK)
>>> check_symbol_exists(srand48 stdlib.h HAVE_RAND48_SRAND48)
>>> if( HAVE_RAND48_SRAND48 )
>>
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>>
>> --
>> This message has been scanned for viruses and
>> dangerous content by MailScanner, and is
>> believed to be clean.
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list