[LLVMdev] llvmc doesn't work for compilation nor linking

Tanya Lattner tonic at nondot.org
Fri Aug 24 16:34:47 PDT 2007



On Aug 24, 2007, at 1:52 PM, Holger Schurig wrote:

> Is llvmc meant for compilation?
>

I'm not sure what the status of llvmc is (is anyone working on it?),  
but I don't believe it was ready for real use or was finished.

If you would like to work on it, patches are welcomed!

Thanks,
Tanya

> $ llvmc -c a.c -o a.o
> /usr/src/llvm/dist/etc/llvm/c:55: Error: Expecting output type value
> /usr/src/llvm/dist/etc/llvm/c had 1 errors. Terminating.
>
>
> The offending line contains:
>
> optimizer.output = bytecode
>
> which doesn't seem to be understood by llvmc. If I uncomment this
> line, I get another error message:
>
> $ llvmc -c a.c -o a.o
> llvmc: Can't find program '%llvmcc1%'
>
>
>
>
> However, I can use it for linking:
>
> $ llvm-gcc --emit-llvm -c a.c -o a.o
> $ llvm-gcc -c main.c -o main.o
> $ llvmc a.o main.o -o main
>
> Wow, nice. Unfortunately, the result doesn't run:
>
> $ ./main
> 'main' function not found in module.
>
>
> That seems true, because llvm-dis doesn't find a main either:
>
> $ llvm-dis main.bc -o -
> ; ModuleID = 'main.bc'
> target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32- 
> i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64- 
> f80:32:32"
> target triple = "i686-pc-linux-gnu"
> @i.b = internal global i1 false         ; <i1*> [#uses=2]
>
> define void @foo2() {
> entry:
>         store i1 true, i1* @i.b, align 1
>         ret void
> }
>
> declare void @foo4()
>
> define i32 @foo1() {
> entry:
>         %tmp1.b = load i1* @i.b, align 1                ; <i1>  
> [#uses=1]
>         br i1 %tmp1.b, label %cond_true, label %return
>
> cond_true:              ; preds = %entry
>         call void @foo4( )
>         ret i32 52
>
> return:         ; preds = %entry
>         ret i32 42
> }
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list