[LLVMdev] What's Going Wrong with GCC 4.6.3 + dragonegg 3.1

Nick Lewycky nicholas at mxc.ca
Sat Jun 16 11:41:06 PDT 2012


Arnamoy Bhattacharyya wrote:
> Hi all;
>
> Problem: Running a bitcode file produced by llvm-gcc (gcc 4.6.3 +
> dragonegg 3.1 + llvm 3.1) with lli (Ubuntu 12.04)
>
> /llvm-gcc:/
>
> llvm-gcc -c hello.c -emit-llvm -o hello.bc
> lli hello.bc
>
> output:
> lli: hello.bc:1:1: error: expected top-level entity
> ELF@4(
>
> /clang:/
>
> clang -c hello.c -emit-llvm -o hello.bc

Dragonegg doesn't handle -emit-llvm, and it's being silently eaten by 
gcc (offhand, I think it passes it down to the linker which in turn 
interprets it as meaning that "mit-llvm" will be the name of the entry 
point function). Try either -flto or -fplugin-arg-dragonegg-emit-ir to 
produce bitcode.

Nick

> lli hello.bc
>
> output:
> hello world
>
> hello.c:
> #include <stdio.h>
> int main() {
>    printf("hello world\n");
>    return 0;
> }
>
> Any suggestions on how to do it in llvm-gcc?
> --
> Arnamoy Bhattacharyya
> Athabasca Hall 143
> Department of Computing Science - University of Alberta
> Edmonton, Alberta, Canada, T6G 2E8
> 587-710-7073
>
>
> _______________________________________________
> 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