[llvm-dev] LLVM IR with MakeFile

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

[llvm-dev] LLVM IR with MakeFile

Zhizhou Yang via llvm-dev
Hi LLVM Devs

I am not sure whether this is the right email to ask such kind of question. If not, please tell me the right mailing list.

I am new to llvm and I am going to use llvm to do some task related to program analysis. Now I would like to generate llvm IR.

I know that  we can use the command like "clang -S -emit-llvm" to get the llvm IR.

However, I would like to have a makefile that can help me to generate the llvm IR.

For example, I am now compiling the coreutils. I use `./configure CC=/path/to/clang  CFLAGS='-S -emit-llvm` to try to generate the target makefile.It doesn't work due to the following error
make[2]: *** No rule to make target `lib/asnprintf.ll.ll', needed by `lib/libcoreutils.a'.  Stop.

I would like to use clang to cross compile the coreutils and the target architecture is ARM. For the purpose of program analysis, I would like to have the LLVM IR generated and also the dwarf information. Can anyone give me some suggestions. Thank you so much

Regards
Muhui

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] LLVM IR with MakeFile

Zhizhou Yang via llvm-dev
On 14 May 2018 at 08:45, Muhui Jiang via llvm-dev
<[hidden email]> wrote:

> Hi LLVM Devs
>
> I am not sure whether this is the right email to ask such kind of question.
> If not, please tell me the right mailing list.
>
> I am new to llvm and I am going to use llvm to do some task related to
> program analysis. Now I would like to generate llvm IR.
>
> I know that  we can use the command like "clang -S -emit-llvm" to get the
> llvm IR.
>
> However, I would like to have a makefile that can help me to generate the
> llvm IR.

You don't really want a makefile based approach. Maintaining your own
makefiles won't scale to large projects. It's better to use the build
system of the existing project

> For example, I am now compiling the coreutils. I use `./configure
> CC=/path/to/clang  CFLAGS='-S -emit-llvm` to try to generate the target
> makefile.It doesn't work due to the following error
> make[2]: *** No rule to make target `lib/asnprintf.ll.ll', needed by
> `lib/libcoreutils.a'.  Stop.

Try https://github.com/travitch/whole-program-llvm
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev