[LLVMbugs] [Bug 21012] New: bitcode can't be executed by MCJIT on ios (arm64)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Sep 20 10:29:29 PDT 2014


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

            Bug ID: 21012
           Summary: bitcode can't be executed by MCJIT on ios (arm64)
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: other
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: dev at antonsmirnov.name
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13057
  --> http://llvm.org/bugs/attachment.cgi?id=13057&action=edit
archive

I've created static lib (using lli source code) to execute LLVM bitcode from
ios app.

I've bundle ready LLVM bitcode file (.ll) in app bundle (targeted to
arm64-apple-ios7.1) and it seems to be correct.

When i try to execute code it crashes in ExecutionEngine.cpp in line:
return runFunction(Fn, GVArgs).IntVal.getZExtValue();

with EXC_BAD_ACCESS (code=260, address=0xd10083ff).

The app should be linked with libclang*.a and libLLVM*.a which are
cross-compiled for armv7.

In order to reproduce the case i attach zip with:
* bug_scr - screenshot of exception in xcode
* build_executor.sh script (to build executor static lib)
* lib_interpreter.cpp/.h which is static lib (code copy-pasted from lli source
code but change InitializeNative* to InitializeAll*)
* LLVMExecutorDemo - ios app to test

Workflow:
1. cross-compile LLVM for ARM (with XCode tooolchain).
i've used --prefix=... --host=i386-apple-darwin11 --enable-threads=no
--disable-threads --disable-terminfo --enable-languages=c,c++ -—enable-zlib=no
—-disable-zlib
configure arguments
2. cross-compile my static lib (use ./build_executor.sh script and change paths
to y ours)
3. compile ios app (and change lib*.a paths to yours)
4. run and see exception
5. fix it ;)

-- 
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/20140920/225c8008/attachment.html>


More information about the llvm-bugs mailing list