[LLVMbugs] [Bug 19257] New: MCJIT on on OSX produces different result from JIT when both _func and func exist

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Mar 26 12:10:06 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19257

            Bug ID: 19257
           Summary: MCJIT on on OSX produces different result from JIT
                    when both _func and func exist
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Generic Execution Engine Support
          Assignee: unassignedbugs at nondot.org
          Reporter: zdevito at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12295
  --> http://llvm.org/bugs/attachment.cgi?id=12295&action=edit
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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140326/c5507984/attachment.html>


More information about the llvm-bugs mailing list