Hi there. Sorry in advance if this is a silly question. I've got a test program in my v3c-storyboard project http://sourceforge.net/projects/v3c-storyboard/ that generates LLVM assembly for a hello world program. If I try clang -o hello-world hello-world.ll I get "error: unable to interface with target machine". But if I llvm-as -o hello-world.bc hello-world.ll && " "llc -o hello-world.S hello-world.bc && " "gcc -o hello-world hello-world.S" itworks. What am I missing? Regards, Philip Ashmore
On 14/11/12 22:11, Philip Ashmore wrote:
> Hi there.
>
> Sorry in advance if this is a silly question.
>
> I've got a test program in my v3c-storyboard project
> http://sourceforge.net/projects/v3c-storyboard/
> that generates LLVM assembly for a hello world program.
>
> If I try
>
> clang -o hello-world hello-world.ll
>
> I get "error: unable to interface with target machine".
>
> But if I
>
> llvm-as -o hello-world.bc hello-world.ll && "
> "llc -o hello-world.S hello-world.bc && "
> "gcc -o hello-world hello-world.S"
>
> it works.
>
> What am I missing?
>
> Regards,
> Philip Ashmore
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
I tested it with llvm 3.2svn but I've got to change v3c-storyboard's
configure
script to look for llvm-config-3.x instead of llvm-config for the llvm 3.1
Debian package.
It doesn't work with llvm 3.0.
Here's the generated file.
; ModuleID = 'my cool jit'
@0 = private unnamed_addr constant [14 x i8] c"Hello, world!\00"
declare i32 @puts(i8*)
define i32 @main(i32, [0 x i8*]) {
entry:
%2 = call i32 @puts(i8* getelementptr inbounds ([14 x i8]* @0, i32 0,
i32 0))
ret i32 0
}
Hi Philip, ...> > I've got a test program in my v3c-storyboard project > > http://sourceforge.net/projects/v3c-storyboard/ > > that generates LLVM assembly for a hello world program. > > > > If I try > > > > clang -o hello-world hello-world.ll > > > > I get "error: unable to interface with target machine"....> ; ModuleID = 'my cool jit' > > @0 = private unnamed_addr constant [14 x i8] c"Hello, world!\00" > > declare i32 @puts(i8*) > > define i32 @main(i32, [0 x i8*]) { > entry: > %2 = call i32 @puts(i8* getelementptr inbounds ([14 x i8]* @0, i32 0, i32 0)) > ret i32 0 > }maybe try putting a target triple in the IR? Perhaps clang needs to know which machine you want to target (while llc guesses). Ciao, Duncan.
Apparently Analagous Threads
- [LLVMdev] unable to interface with target machine
- [LLVMdev] [cfe-dev] RFC: A Great Renaming of Things (or: Let's Repaint ALL the Bikesheds!)
- [LLVMdev] unable to interface with target machine
- [LLVMdev] [cfe-dev] RFC: A Great Renaming of Things (or: Let's Repaint ALL the Bikesheds!)
- [LLVMdev] unable to interface with target machine