[llvm-dev] Issue with HelloWorld pass

Asit Dhal via llvm-dev llvm-dev at lists.llvm.org
Tue Aug 2 18:41:54 PDT 2016


Hi,

Why don't you use https://github.com/sampsyo/llvm-pass-skeleton ?

If cmake doesn't pick up the path automatically, just export

If you have problems in setting up LLVM, you can use docker as a 
development container.

https://github.com/d11wtq/llvm-docker/blob/master/Dockerfile

I faced some problem initially, I use docker container and it works.

On 8/3/2016 03:12, Alessandro Fanfarillo via llvm-dev wrote:
> Dear all,
> I'm new to the LLVM world and I'm trying to run reproduce the hello
> world example described here
> http://llvm.org/releases/3.8.1/docs/WritingAnLLVMPass.html.
>
> I started with a fresh new llvm-3.8.1 installation based on cmake
> (running on Linux x86) using the following command:
>
> cmake -DCMAKE_INSTALL_PREFIX=/path/to/llvm -DLLVM_TARGETS_TO_BUILD="X86" ../
>
> The build directory was inside the top directory of the llvm-3.8.1 source.
>
> I copied and pasted the pass example reported at the end of the "Basic
> code required" section and I managed to compile everything correctly
> with CMake.
> Because there is already a Hello example (with the correspondent
> LLVMHello.so file), I decided to call it NewHello.
>
> When I try to test the pass with the following string
>
> opt -load /path/to/llvm-3.8.1.src/build/lib/LLVMNewHello.so -hello <
> new_hello.bc > /dev/null
>
> I get the following error:
> Expected no forward declarations!
> !0 = <temporary!> !{}
> incorrect number of operands in llvm.ident metadata
> !0 = <temporary!> !{}
> opt: -: error: input module is broken!
>
> I've also tried with the LLVMHello.so file but I got the same error message.
>
> Do you have any suggestions?
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

-- 
Warm Regards,
Asit Dhal
http://asit-dhal.github.io/



More information about the llvm-dev mailing list