[LLVMdev] Static linking of execution engine

Kaylor, Andrew andrew.kaylor at intel.com
Tue May 21 12:57:19 PDT 2013

Yeah, this is a problem with the static constructor getting optimized out.  Including "JIT.h" is supposed to fix that.

Is it possible that the file where you are including "JIT.h" doesn't have any required code in it?


-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Mario Schwalbe
Sent: Tuesday, May 21, 2013 4:52 AM
To: LLVM Devel
Subject: [LLVMdev] Static linking of execution engine


I'm on Linux and trying to link an application that makes use of LLVM's JIT execution engine statically.

(1) LLVM libs are compiled as static libraries.
(2) Called InitializeNativeTarget().
(3) Included llvm/ExecutionEngine/JIT.h.

It works if I build and link regularly.

However, if I add -static when linking, the execution engine fails to initialize. Does anyone know why? LLVM libs are already archives. Is that supported at all?

Thanks & ciao,
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu

More information about the llvm-dev mailing list