LLVM Win32 Issue

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

LLVM Win32 Issue

Aaron Aaron
Hello all,

I'm trying to bring an LLVM-based project that is working on Linux up
on Win32.  I am having problems with llvm::ExecutionEngine::create
returning a NULL.  I traced it to these lines:

  // Unless the interpreter was explicitly selected, try making a JIT.
  if (!ForceInterpreter && JITCtor)
    EE = JITCtor(MP, ErrorStr);

  // If we can't make a JIT, make an interpreter instead.
  if (EE == 0 && InterpCtor)
    EE = InterpCtor(MP, ErrorStr);

JITCtor and InterpCtor are both NULL, so it's obvious why I'm getting
back a NULL execution engine.  I am pretty sure it's because I'm
missing a few llvm .lib or .obj files.  What is the set of llvm object
files needed at link time for Win32 on X86 JIT?

Thanks very much for any help,

Aaron
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: LLVM Win32 Issue

Chuck Rose III

You'll need to link in x86.lib as generated from the VStudio project.

I had trouble convincing VStudio's linker to keep the relevant code
around, so did this in the app I work on:

void
LLVMCompiledProgram::linkerTrick()
{
    llvm::Module staticModule("staticModule");
    std::string staticString;
    llvm::X86_32TargetMachine staticMachine(staticModule, staticString);
}

Which I called from somewhere real.

Chuck.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
On Behalf Of Aaron Dwyer
Sent: Wednesday, February 20, 2008 5:24 PM
To: [hidden email]
Subject: [LLVMdev] LLVM Win32 Issue

Hello all,

I'm trying to bring an LLVM-based project that is working on Linux up
on Win32.  I am having problems with llvm::ExecutionEngine::create
returning a NULL.  I traced it to these lines:

  // Unless the interpreter was explicitly selected, try making a JIT.
  if (!ForceInterpreter && JITCtor)
    EE = JITCtor(MP, ErrorStr);

  // If we can't make a JIT, make an interpreter instead.
  if (EE == 0 && InterpCtor)
    EE = InterpCtor(MP, ErrorStr);

JITCtor and InterpCtor are both NULL, so it's obvious why I'm getting
back a NULL execution engine.  I am pretty sure it's because I'm
missing a few llvm .lib or .obj files.  What is the set of llvm object
files needed at link time for Win32 on X86 JIT?

Thanks very much for any help,

Aaron
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: LLVM Win32 Issue

Óscar Fuentes
In reply to this post by Aaron Aaron
"Aaron Dwyer" <[hidden email]> writes:

[snip]

> JITCtor and InterpCtor are both NULL, so it's obvious why I'm getting
> back a NULL execution engine.  I am pretty sure it's because I'm
> missing a few llvm .lib or .obj files.  What is the set of llvm object
> files needed at link time for Win32 on X86 JIT?

This is what I use on MinGW. It is for 2.1. I hope 2.2 is similar:


LIBFILES = $(LLVM_LIB_PATH)LLVMX86.o \
        $(LLVM_LIB_PATH)LLVMExecutionEngine.o \
        $(LLVM_LIB_PATH)LLVMJIT.o \
        -lLLVMAsmParser \
        -lLLVMSelectionDAG \
        -lLLVMCodeGen \
        -lLLVMScalarOpts \
        -lLLVMTransformUtils \
        -lLLVMAnalysis  \
        -lLLVMTarget \
        -lLLVMCore \
        -lLLVMSupport \
        -lLLVMSystem \
        -lpsapi \
        -ldbghelp

If you are on VS, .o is .obj and -lLLVMWhatever is Whatever.lib.

If you still have problems, examine the commands that are executed for
building some example (examples/Fibonacci/fibonacci.cpp for instance).

HTH

--
Oscar

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: LLVM Win32 Issue

Evan Cheng-2
You can use llvm-config --libs. It will tell you how to link llvm  
libraries into your app.

Evan

On Feb 20, 2008, at 6:14 PM, Óscar Fuentes wrote:

> "Aaron Dwyer" <[hidden email]> writes:
>
> [snip]
>
>> JITCtor and InterpCtor are both NULL, so it's obvious why I'm getting
>> back a NULL execution engine.  I am pretty sure it's because I'm
>> missing a few llvm .lib or .obj files.  What is the set of llvm  
>> object
>> files needed at link time for Win32 on X86 JIT?
>
> This is what I use on MinGW. It is for 2.1. I hope 2.2 is similar:
>
>
> LIBFILES = $(LLVM_LIB_PATH)LLVMX86.o \
> $(LLVM_LIB_PATH)LLVMExecutionEngine.o \
> $(LLVM_LIB_PATH)LLVMJIT.o \
> -lLLVMAsmParser \
> -lLLVMSelectionDAG \
> -lLLVMCodeGen \
> -lLLVMScalarOpts \
> -lLLVMTransformUtils \
> -lLLVMAnalysis  \
> -lLLVMTarget \
> -lLLVMCore \
> -lLLVMSupport \
> -lLLVMSystem \
> -lpsapi \
> -ldbghelp
>
> If you are on VS, .o is .obj and -lLLVMWhatever is Whatever.lib.
>
> If you still have problems, examine the commands that are executed for
> building some example (examples/Fibonacci/fibonacci.cpp for instance).
>
> HTH
>
> --
> Oscar
>
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev