rust - What can be the reason of `LLVM ERROR: Target does not support MC emission!`? -


I am currently working on Roost in LLVM tutorial. I have already implemented parts of the Kalidoscope REPL. It used to work well for me, but suddenly stopped it to work and LLVM error: every attempt to calculate a value in the target MC does not support emissions it seems now That's it's happy after updating the latest compiler to the latest night (but I'm not sure here).

Follow the relevant piece of code.

Initial function:

  # [permission (non_snackcase)] Pub unprotected FNLDVMI initiatesNative targets (llvm :: LLVMInitializeX86TargetInfo (); LLVM :: LLVMInitializeX86Target (); LLVM :: LLVMInitializeX86TargetMC (); }   

Module creation:

  module = llvm :: LLVMModuleCreateWithNameInContext (module_name.to_c_str). as_ptr (), context);   

Performance engine creation:

  let exec_engine = 0 as llvm :: ExecutionEngineRef; Give error = 0 as * const c_char; LLVMCreateExecutionEngineForModule (& amp; Function, Module, and Error;); Insist! (Exec_engine! = Llvm as Ex: = EngineRef Execution);   

Function compiling and running:

  Pub FN Run (Value: LLM :: Valerieuf, Context: & amp; Theme) - & gt; F64 {insecure {result = LLVMRunFunction (context.exec_engine; value; 0; 0; const genericValueRef as); Let ty = llvm :: LLVMDoubleTypeInContext (context.context); LLVMGenericValueToFloat (ty, results)}}   

are imported by LLWM by preflxed LLVM functions :: rustc, which are not prefexed by LLVM :: are imported by my code, see .

To see the complete code list,

See I am using the latest night of war and LLWM 3.5.0

UPD: Launched by LLVMI. After commenting about the call for the Native Targ, GIT started working again. But I am still wondering what is the cause of the problem and how GIT should be used correctly.

UPD2: After commenting the line with initialization, everything did not work again: the function in the call defines the code with the LLVM error: execution of an unknown external function Tried now

The function I am trying to call (previously worked):

  # [no_mangle] pub extern fn print (x: f64) - & Gt; F64 {println! ("& Gt; {} <", x); X}   

Example session:

  jauhien @ zcj iron-copy% ./target/iron_kaleidoscope & gt; Extern print (x) double @ print double) & gt; Print (1) llv error: tried to execute unknown external function: print    

I had and could also solve it by turning it on

  LLVMInitializeNativeAsmPrinter (); LLVMInitializeNativeAsmParser (); After starting X86Target   

I found it in the source code of lli .

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -