vivek pandya via llvm-dev
2015-Oct-22 20:19 UTC
[llvm-dev] Building LLVM Pass with in Source Tree
Hello , I am following http://llvm.org/docs/WritingAnLLVMPass.html this to build a simple pass with in the source tree. When I try to run make command on my pass directory. I am getting following error: ../../../Makefile.common:60: ../../../Makefile.config: No such file or directory ../../../Makefile.common:68: /Makefile.rules: No such file or directory make: *** No rule to make target `/Makefile.rules'. Stop. But I think this common as I have not run ./configure on my source tree. When I try to run ./configure on my LLVM source tree I am getting following error: configure: error: In-source builds are not allowed. Please configure from a separate build directory! Now I build LLVM with separate source directory and put my pass directory inside of my build tree. Then I run make it builds successfully. opt is able to load my pass correctly. But here my question is " *Is this a correct way to build the pass ?*" and if In-source builds are not allowed then http://llvm.org/docs/WritingAnLLVMPass.html needs to be updated. Please guide ! -- *Vivek Pandya* -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151023/3ff1efdd/attachment.html>
Jonathan Roelofs via llvm-dev
2015-Oct-22 20:54 UTC
[llvm-dev] Building LLVM Pass with in Source Tree
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.> > ../../../Makefile.common:60: ../../../Makefile.config: No such file or > directory > > ../../../Makefile.common:68: /Makefile.rules: No such file or directory > > make: *** No rule to make target `/Makefile.rules'. Stop. > > > But I think this common as I have not run ./configure on my source tree. > When I try to run ./configure on my LLVM source tree I am getting > following error: > > configure: error: In-source builds are not allowed. Please configure > from a separate build directory! > > > Now I build LLVM with separate source directory and put my pass > directory inside of my build tree. Then I run make it buildsYour pass directory should go somewhere in the source dir, not the build dir.> successfully. opt is able to load my pass correctly. > But here my question is " *Is this a correct way to build the pass ?*" > and if In-source builds are not allowed then > http://llvm.org/docs/WritingAnLLVMPass.html needs to be updated.Can you point me to the specific instructions there that confused you? Jon> > Please guide ! > > -- > > *Vivek Pandya* > > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-- Jon Roelofs jonathan at codesourcery.com CodeSourcery / Mentor Embedded
Jonathan Roelofs via llvm-dev
2015-Oct-23 17:50 UTC
[llvm-dev] Building LLVM Pass with in Source Tree
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 tutorialI'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