Robert Henry via llvm-dev
2019-Aug-14 18:40 UTC
[llvm-dev] Can I build llvm with only a handful of source files compiled for debug?
In order to minimize edit/compile/debug turn time, is there a way to compile llvm tools so that the majority of the files are compiled as if for release (eg, no debug symbols), and only the handful of files that I have touched are compiled for debugging? This will reduce the load on the file system, linker and gdb tremendously. At present, AFAICT, it's all or nothing. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190814/39d6debf/attachment.html>
David Blaikie via llvm-dev
2019-Aug-14 18:51 UTC
[llvm-dev] Can I build llvm with only a handful of source files compiled for debug?
Nothing supported, though might not be too hard to do by hand. If you're having long link times, lots of disk usage, and slow gdb startup time I'd recommend enabling split DWARF (LLVM_USE_SPLIT_DWARF=ON, and CMAKE_EXE_LINKER_FLAGS_*=-Wl,-gdb-index in cmake) if you haven't already. On Wed, Aug 14, 2019 at 11:40 AM Robert Henry via llvm-dev < llvm-dev at lists.llvm.org> wrote:> In order to minimize edit/compile/debug turn time, is there a way to > compile llvm tools so that the majority of the files are compiled as if for > release (eg, no debug symbols), and only the handful of files that I have > touched are compiled for debugging? This will reduce the load on the file > system, linker and gdb tremendously. At present, AFAICT, it's all or > nothing. > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190814/a5a2c3b0/attachment.html>
Praveen Velliengiri via llvm-dev
2019-Aug-14 19:00 UTC
[llvm-dev] Can I build llvm with only a handful of source files compiled for debug?
Actually, I have same question, If llvm build provides a option similar to that, it will be lot more easier for people doing development in relatively less (compute, storage) PC's. On Thu, 15 Aug 2019 at 00:22, David Blaikie via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Nothing supported, though might not be too hard to do by hand. > > If you're having long link times, lots of disk usage, and slow gdb startup > time I'd recommend enabling split DWARF (LLVM_USE_SPLIT_DWARF=ON, > and CMAKE_EXE_LINKER_FLAGS_*=-Wl,-gdb-index in cmake) if you haven't > already. > > On Wed, Aug 14, 2019 at 11:40 AM Robert Henry via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> In order to minimize edit/compile/debug turn time, is there a way to >> compile llvm tools so that the majority of the files are compiled as if for >> release (eg, no debug symbols), and only the handful of files that I have >> touched are compiled for debugging? This will reduce the load on the file >> system, linker and gdb tremendously. At present, AFAICT, it's all or >> nothing. >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190815/e6a65420/attachment.html>
Daniel Sanders via llvm-dev
2019-Aug-14 20:14 UTC
[llvm-dev] Can I build llvm with only a handful of source files compiled for debug?
Clang has a way to achieve this. Once you've built LLVM without debug info, you can then delete the objects or modify the sources you want to debug and then rebuild with something like 'CCC_OVERRIDE_OPTIONS="+-g +-O0" ninja'. The newly built files will have debug info.> On Aug 14, 2019, at 11:40, Robert Henry via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > In order to minimize edit/compile/debug turn time, is there a way to compile llvm tools so that the majority of the files are compiled as if for release (eg, no debug symbols), and only the handful of files that I have touched are compiled for debugging? This will reduce the load on the file system, linker and gdb tremendously. At present, AFAICT, it's all or nothing. > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev <https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev>-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190814/b5ce16b8/attachment.html>
Mark de Wever via llvm-dev
2019-Aug-17 10:46 UTC
[llvm-dev] Can I build llvm with only a handful of source files compiled for debug?
On Wed, Aug 14, 2019 at 06:40:17PM +0000, Robert Henry via llvm-dev wrote:> In order to minimize edit/compile/debug turn time, is there a way to > compile llvm tools so that the majority of the files are compiled as > if for release (eg, no debug symbols), and only the handful of files > that I have touched are compiled for debugging? This will reduce the > load on the file system, linker and gdb tremendously. At present, > AFAICT, it's all or nothing.Disclaimer I have only tested this while working on Clang, but I assume it works for the entire LLVM project. I have enabled shared libraries in CMake. Then I add the following lines to the CMakeLists.txt, for example clang/lib/Parse/CMakeLists.txt set_source_files_properties( ParseDeclCXX.cpp ParseDecl.cpp Parser.cpp ParseStmt.cpp ParseExpr.cpp ParseExprCXX.cpp ParseInit.cpp PROPERTIES COMPILE_FLAGS "-O0 -g" ) Then rebuild the clangParse target and have the debug symbols available. Hope this helps. Kind regards, Mark de Wever
Rui Ueyama via llvm-dev
2019-Aug-19 06:29 UTC
[llvm-dev] Can I build llvm with only a handful of source files compiled for debug?
Since we are talking about a long link time and no one has mentioned about lld so far, I'd like to make sure that you are using lld, which is significantly faster than most other linkers. On Thu, Aug 15, 2019 at 3:40 AM Robert Henry via llvm-dev < llvm-dev at lists.llvm.org> wrote:> In order to minimize edit/compile/debug turn time, is there a way to > compile llvm tools so that the majority of the files are compiled as if for > release (eg, no debug symbols), and only the handful of files that I have > touched are compiled for debugging? This will reduce the load on the file > system, linker and gdb tremendously. At present, AFAICT, it's all or > nothing. > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190819/8b37f4e7/attachment.html>