Hi Mikhail, Thanks for your wonderful help so far. I have few more questions to ask: How do I modify the driver to pick tools from where the driver itself resides, rather than from the PATH? And how to make sure that we have same behavior on Windows as far as paths (/ Vs \) and picking up tools from the driver directory is concerned? Do I need to write some C++ code to customize such behaviors? Thanks, Sanjiv Mikhail Glushenkov wrote:> Hi Sanjiv, > > 2009/6/15 Sanjiv Gupta <sanjiv.gupta at microchip.com>: > >> I configure llvm into a separate directory from source. >> When I do the steps you mentioned in the source directory, this is what I >> get. >> > > In that case, copy $LLVM_DIR/tools/llvmc/example/mcc16/Makefile to > $LLVM_OBJ_DIR/tools/llvmc/example/mcc16/Makefile and build from that > directory. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Hi Sanjiv, 2009/6/18 Sanjiv Gupta <sanjiv.gupta at microchip.com>:> Hi Mikhail, > Thanks for your wonderful help so far. I have few more questions to ask: > > How do I modify the driver to pick tools from where the driver itself > resides, rather than from the PATH? > Do I need to write some C++ code to customize such behaviors?Yes, this is what hooks are for. You're supposed to change the cmd_line property to something like this: (cmd_line "$CALL(PrependCustomizedPath, 'toolname') --tool --options") The PrependCustomizedPath function above is implemented in C++ (just drop a .cpp file into the plugin directory).> And how to make sure that we have same behavior on Windows as far as paths > (/ Vs \) and picking up tools from the driver directory is concerned?Right now, you can't do OS detection in TableGen code, so you should use hooks for platform-specific things. Also, do not hesitate to mail me or file a bug if you notice some warts in Windows support. One known issue is that DLL plugins do not work. I test on both Linux and Windows, but develop mainly on Linux. BTW, Chris's Makefile changes broke llvmc yesterday (r75379). I'm working on a fix. -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
> BTW, Chris's Makefile changes broke llvmc yesterday (r75379). I'm > working on a fix.Hi Mikhail, Did you get a chance to fix this. I still get errors while building examples. i00202 at ubuntu:~/projects/llvm/tools/llvmc/example/mcc16$ make make[1]: Entering directory `/home/i00202/projects/llvm/tools/llvmc/example/mcc16/plugins' make[2]: Entering directory `/home/i00202/projects/llvm/tools/llvmc/example/mcc16/plugins/PIC16Base' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/home/i00202/projects/llvm/tools/llvmc/example/mcc16/plugins/PIC16Base' make[1]: Leaving directory `/home/i00202/projects/llvm/tools/llvmc/example/mcc16/plugins' make[1]: Entering directory `/home/i00202/projects/llvm/tools/llvmc/example/mcc16/driver' make[1]: *** No rule to make target `/home/i00202/projects/llvm/Debug/lib/plugin_llvmc_PIC16Base.o', needed by `/home/i00202/projects/llvm/Debug/bin/mcc16'. Stop. make[1]: Leaving directory `/home/i00202/projects/llvm/tools/llvmc/example/mcc16/driver' make: *** [all] Error 1 This is with srcdir = objdir. I get the same error even when srcdir and objdir are separate. Thanks, Sanjiv -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090622/787f20e3/attachment.html>
Mikhail Glushenkov wrote:> Hi Sanjiv, > > 2009/6/18 Sanjiv Gupta <sanjiv.gupta at microchip.com>: > >> Hi Mikhail, >> Thanks for your wonderful help so far. I have few more questions to ask: >> >> How do I modify the driver to pick tools from where the driver itself >> resides, rather than from the PATH? >> Do I need to write some C++ code to customize such behaviors? >> > > Yes, this is what hooks are for. You're supposed to change the > cmd_line property to something like this: > > (cmd_line "$CALL(PrependCustomizedPath, 'toolname') --tool --options") > > The PrependCustomizedPath function above is implemented in C++ (just > drop a .cpp file into the plugin directory). > >Hi Mikhail, I want to retrieve the value of argv[0] (which was passed to main function of the driver) in PrependCustomizedPath. Do we have some standard name for argv[0] in tablegen? - Sanjiv