<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - MCJIT on on OSX produces different result from JIT when both _func and func exist"
href="http://llvm.org/bugs/show_bug.cgi?id=19257">19257</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>MCJIT on on OSX produces different result from JIT when both _func and func exist
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Generic Execution Engine Support
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>zdevito@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=12295" name="attach_12295" title="code for dynamic library">attachment 12295</a> <a href="attachment.cgi?id=12295&action=edit" title="code for dynamic library">[details]</a></span>
code for dynamic library
When jitting code that links against symbols in a dynamic library, MCJIT will
link a reference to function 'func' against symbol '_func' if both 'func' and
'_func' exist in the dynamic library. This is different from the old JIT which
would link against 'func'. This currently causes problems using pthreads on OSX
since both _pthread_create and pthread_create are valid symbols that define
different functions.
Example:
dnab404670:tests zdevito$ ~/llvm-34-final/bin/clang library.c -c -o library.o
dnab404670:tests zdevito$ ~/llvm-34-final/bin/clang -dynamiclib library.o -o
library.dylib
dnab404670:tests zdevito$ ~/llvm-34-final/bin/lli -load=library.dylib
bitcode.ll
func
dnab404670:tests zdevito$ ~/llvm-34-final/bin/lli -load=library.dylib
-use-mcjit bitcode.ll
_func</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>