[LLVMdev] JIT on armhf

David Given dg at cowlark.com
Sat Feb 9 03:29:19 PST 2013


On 08/02/13 23:07, Amara Emerson wrote:
[...]
> IIRC, this error might be due to not linking against the MCJIT library
> component. Add the appropriate flags to your build config, and also
> ensure that you call InitializeNativeTargetAsmPrinter() and
> InitializeNativeTargetAsmParser().

Thanks; that now makes MCJIT generate code. (For reference, the secret
magic is apparently to call LLVMLinkInMCJIT().)

Unfortunately... after doing the code generation it crashes. The top of
the stack trace looks like this, according to valgrind:

==7470==    at 0xE9B2C9:
llvm::RuntimeDyldImpl::emitSection(llvm::ObjectImage&,
llvm::object::SectionRef const&, bool) (RuntimeDyld.cpp:258)
==7470==    by 0xE9AAC5:
llvm::RuntimeDyldImpl::findOrEmitSection(llvm::ObjectImage&,
llvm::object::SectionRef const&, bool,
std::map<llvm::object::SectionRef, unsigned int,
std::less<llvm::object::SectionRef>,
std::allocator<std::pair<llvm::object::SectionRef const, unsigned int> >
>&) (RuntimeDyld.cpp:314)
==7470==    by 0xE9A0C2:
llvm::RuntimeDyldImpl::loadObject(llvm::ObjectBuffer*) (RuntimeDyld.cpp:120)
==7470==    by 0xE9BF7C:
llvm::RuntimeDyld::loadObject(llvm::ObjectBuffer*) (RuntimeDyld.cpp:497)
==7470==    by 0xE9572A: llvm::MCJIT::emitObject(llvm::Module*)
(MCJIT.cpp:103)
==7470==    by 0xE959A0:
llvm::MCJIT::getPointerToFunction(llvm::Function*) (MCJIT.cpp:146)

And, from looking at the machine code dumped out by turning on
llvm::TargetOptions::printMachineCode, it's *still* generating ARM
softfloat code.

The good news about the crash is that it's happening on both ARM and
amd64, which means that it's most likely something I'm doing wrong,
which means I can fix it. I, er, just don't know how. Any suggestions as
to what I'm not doing right? My usual tactic of compiling against a
version of LLVM with assertions turned on isn't helping here.

In addition, does anyone happen to have a set of vanilla LLVM 3.2
libraries compiled for armhf that they can send me? I'd like to verify
or rule out whether there's a problem with the Debian packages.

[...]
> The MCJIT uses the exact same mechanism as the static code generator
> so the code quality is therefore good.

That's very good to hear.

-- 
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│ "Of course, on a sufficiently small planet, 40 km/hr is, in fact,
│ sufficient to punt the elastic spherical cow into low orbit." ---
│ Brooks Moses on r.a.sf.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130209/1e451e14/attachment.sig>


More information about the llvm-dev mailing list