[llvm-dev] Building LLVM Pass with in Source Tree

Jonathan Roelofs via llvm-dev llvm-dev at lists.llvm.org
Fri Oct 23 10:50:03 PDT 2015



On 10/22/15 11:00 PM, vivek pandya wrote:
>
>
> On Fri, Oct 23, 2015 at 2:24 AM, Jonathan Roelofs
> <jonathan at codesourcery.com <mailto:jonathan at codesourcery.com>> wrote:
>
>
>
>     On 10/22/15 2:19 PM, vivek pandya via llvm-dev wrote:
>
>         Hello ,
>
>         I am following http://llvm.org/docs/WritingAnLLVMPass.html this
>         to build
>         a simple pass with in the source tree.
>
>
>     There's two meanings of "in source" here. One of them is "your new
>     pass lives alongside all the other passes in the source directory",
>     and the other is "your build directory is your source directory,
>     i.e. `./configure` not `../llvm/configure`)". The latter is
>     specifically forbidden by the message you encountered. The former is
>     encouraged, but not required (and there are instructions on how to
>     build "out of source" passes in there somewhere too).
>
>
>         When I try to run make command on my pass directory. I am getting
>         following error:
>
>
>     Make needs to be run from the top level of the _build_ directory,
>     not from one of the subdirs of the _source_ directory.
>
>          This is contradicting to compile the file with a simple “gmake”
>     command in the local directory and you should get a new file
>     “Debug+Asserts/lib/Hello.so”  as given in tutorial

I've fixed this part of the docs in r251127. If you see any other 
references to in-source builds in the docs, please let me know.

>
>     running *../llvm/configure* followed by *make* on build directory
>     will build the whole llvm again right  ?
>

Yes. Though once you've added the new folder & makefile, and configured, 
there shouldn't be a need to configure again. Running gmake from the top 
level of your build directory should re-build only the parts that need it.


Jon

>


-- 
Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded


More information about the llvm-dev mailing list