<div dir="ltr">I've found Mutex.cpp file in llvm sources and it seems it's not the first mutex-related call in constructor.<div>This makes me think it's really absent method in system libs:</div><div><br></div>
<font face="courier new, monospace">// Construct a Mutex using pthread calls<br><br>MutexImpl::MutexImpl( bool recursive)<br><br>  : data_(0)<br><br>{<br><br>  // Declare the pthread_mutex data structures<br><br>  pthread_mutex_t* mutex =<br>
<br>    static_cast<pthread_mutex_t*>(malloc(sizeof(pthread_mutex_t)));<br><br>  pthread_mutexattr_t attr;<br><br><br>  // Initialize the mutex attributes<br><br>  int errorcode = pthread_mutexattr_init(&attr);<br>
<br>  assert(errorcode == 0); (void)errorcode;<br><br><br>  // Initialize the mutex as a recursive mutex, if requested, or normal<br><br>  // otherwise.<br><br>  int kind = ( recursive  ? PTHREAD_MUTEX_RECURSIVE : PTHREAD_MUTEX_NORMAL );<br>
<br>  errorcode = pthread_mutexattr_settype(&attr, kind);<br><br>  assert(errorcode == 0);<br><br><br>#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && \<br><br>    !defined(__DragonFly__) && !defined(__Bitrig__)<br>
<br>  // Make it a process local mutex<br><br>  errorcode = pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_PRIVATE);<br><br>  assert(errorcode == 0);<br><br>#endif<br><br><br>  // Initialize the mutex<br><br>  errorcode = pthread_mutex_init(mutex, &attr);<br>
<br>  assert(errorcode == 0);<br><br><br>  // Destroy the attributes<br><br>  errorcode = pthread_mutexattr_destroy(&attr); // fails here<br><br>  assert(errorcode == 0);</font><div><font face="courier new, monospace"><br>
  // Assign the data member<br>  data_ = mutex;<br><br>}</font></div><div><font face="courier new, monospace"><br></font></div>I've marked where it fails.<div>How can that be that previous mutex-related methods success and this one fails?</div>
<div>What can i do to fix it?</div><div><br></div><div>Regards, Anton.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-05 19:31 GMT+06:00 Anton Smirnov <span dir="ltr"><<a href="mailto:dev@antonsmirnov.name" target="_blank">dev@antonsmirnov.name</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi.<div><br></div><div>I was able to cross-compile llvm/clang for i386 and i'm trying to use it in my ios app.</div>
<div>Also i was able to add headers and static libs (both libLLVM*.a and libclang*.a) and compile/link the project with no errors.</div>
<div><br></div><div>But when trying to run simple app i'm getting error:</div><div><br></div><div>







<p><b>Detected an attempt to call a symbol in system libraries that is not present on the iPhone:</b></p>
<p><b>pthread_mutexattr_destroy$UNIX2003 called from function _ZN4llvm3sys9MutexImplC2Eb in image LibClangUsageDemo3.</b></p></div><div><br></div><div>What can i do in order to fix it?</div><div><br></div><div>Is it llvm/clang issue or i'm doing smth wrong?</div>

<div><br></div><div>Regards, Anton.</div></div>
</blockquote></div><br></div>