<div dir="ltr"><div>Hi all,</div><div>I have got a lot of useful advice from many different people in this thread. Is it possible for me to make a page in the wiki or a section perhaps summarising all of these points?</div><div>Warm regards,</div><div>Deep<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 15, 2021 at 8:32 AM David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Ah, It's "-Wl,--gdb-index" the character after 'W' is lower-case L,<br>
not upper case i. (L for Linker). And it's a comma, not a space,<br>
between "-Wl" and "--gdb-index"<br>
<br>
On Thu, Jan 14, 2021 at 6:58 PM Deep Majumder<br>
<<a href="mailto:deep.majumder2019@gmail.com" target="_blank">deep.majumder2019@gmail.com</a>> wrote:<br>
><br>
> Hi David,<br>
> Sorry to annoy you. I have lld enabled via LLVM_ENABLE_LLD=ON. To use -WI and --gdb-index, I set CMAKE_EXE_LINKER_FLAGS_DEBUG=-WI --gdb-index in CMakeCache.txt. But that doesn't work out and I get the following error:<br>
> c++: error: unrecognized command line option ‘-WI’; did you mean ‘-I’?<br>
> c++: error: unrecognized command line option ‘--gdb-index’; did you mean ‘--no-index’?<br>
><br>
> Why does this happen?<br>
> Warm Regards,<br>
> Deep<br>
><br>
><br>
> On Fri, Jan 15, 2021 at 7:39 AM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br>
>><br>
>> You'd need gold or lld - ld.bfd doesn't support gdb-index.<br>
>><br>
>> On Thu, Jan 14, 2021 at 6:04 PM Deep Majumder<br>
>> <<a href="mailto:deep.majumder2019@gmail.com" target="_blank">deep.majumder2019@gmail.com</a>> wrote:<br>
>> ><br>
>> > Hi David,<br>
>> > Do you use ld, gold or lld as the linker. I am getting an unknown flag error with lld for the --gdb-index.<br>
>> > Warm regards,<br>
>> > Deep<br>
>> ><br>
>> > On Thu, Jan 14, 2021, 11:38 PM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br>
>> >><br>
>> >> gdb startup time can be reduced significantly by using a linker-generated index. Compile with -ggnu-pubnames and link with -Wl,--gdb-index. I use this configuration (plus Split DWARF, fwiw) and gdb startup time is only a few seconds/quite usabel.<br>
>> >><br>
>> >> On Thu, Jan 14, 2021 at 9:58 AM Deep Majumder via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
>> >>><br>
>> >>> Hi all,<br>
>> >>> As Stefanos had pointed out, GDB takes an awful lot of time to even start on a debug build of an executable (say clang). LLDB works better but still isn't quite smooth to work with (takes a long time to set breakpoints). So what do LLVM devs who use Linux use for debugging, or is Windows the predominant platform of development?<br>
>> >>> Warm regards,<br>
>> >>> Deep<br>
>> >>><br>
>> >>> On Wed, Jan 13, 2021, 12:26 AM <<a href="mailto:paul.robinson@sony.com" target="_blank">paul.robinson@sony.com</a>> wrote:<br>
>> >>>><br>
>> >>>> Re CLion: The LLVM *Project* (presumably meaning the Foundation) does not pay core developers. It does pay for some infrastructure staff IIRC.<br>
>> >>>><br>
>> >>>> However, the project is primarily funded by commercial companies (you should be able to find documentation of the contributors on the Foundation website), so I think on that count it would not qualify for the free CLion.<br>
>> >>>><br>
>> >>>> --paulr<br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>> From: llvm-dev <<a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank">llvm-dev-bounces@lists.llvm.org</a>> On Behalf Of Chris Tetreault via llvm-dev<br>
>> >>>> Sent: Tuesday, January 12, 2021 1:34 PM<br>
>> >>>> To: Deep Majumder <<a href="mailto:deep.majumder2019@gmail.com" target="_blank">deep.majumder2019@gmail.com</a>>; LLVM Dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>><br>
>> >>>> Subject: Re: [llvm-dev] Beginning developer questions<br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>> I’ve had good luck using QTCreator for large C++ projects in the past. Unlike CLion, QTCreator is actually free. It may be worth taking a look.<br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>> From: llvm-dev <<a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank">llvm-dev-bounces@lists.llvm.org</a>> On Behalf Of Deep Majumder via llvm-dev<br>
>> >>>> Sent: Tuesday, January 12, 2021 9:52 AM<br>
>> >>>> To: Madhur Amilkanthwar <<a href="mailto:madhur13490@gmail.com" target="_blank">madhur13490@gmail.com</a>><br>
>> >>>> Cc: llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>><br>
>> >>>> Subject: [EXT] Re: [llvm-dev] Beginning developer questions<br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>> Hi Stefanos and Madhur,<br>
>> >>>><br>
>> >>>> Of course it would be great if LLVM is given licenses by JetBrains as it would benefit many people(I guess) working on this project who are not students.<br>
>> >>>><br>
>> >>>> I am a student and so have a free license anyway.<br>
>> >>>><br>
>> >>>> Also, thank you David for the link.<br>
>> >>>><br>
>> >>>> Warm Regards,<br>
>> >>>><br>
>> >>>> Deep<br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>> On Tue, Jan 12, 2021 at 11:17 PM Madhur Amilkanthwar <<a href="mailto:madhur13490@gmail.com" target="_blank">madhur13490@gmail.com</a>> wrote:<br>
>> >>>><br>
>> >>>> Hi Stefanos,<br>
>> >>>><br>
>> >>>> Speaking of CLion, their page says open source projects can qualify for free licenses. I am not sure if LLVM community qualifies as per the below required qualifications:<br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>> Do not pay their core project developers.<br>
>> >>>><br>
>> >>>> Meet the Open Source definition.<br>
>> >>>><br>
>> >>>> Are in active development, i.e. new code commits are submitted regularly within the past 3 months.<br>
>> >>>><br>
>> >>>> Do not provide paid versions of open source software or any commercial services around the Open Source project (e.g. paid support, consulting, etc).<br>
>> >>>><br>
>> >>>> Are not funded by commercial companies or organizations (NGO, educational, research, or governmental).<br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>> On Tue, Jan 12, 2021 at 10:31 PM David Blaikie via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>> On Tue, Jan 12, 2021 at 7:35 AM Deep Majumder via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
>> >>>><br>
>> >>>> Thanks everyone for the advice! I am able to build LLVM now without causing my laptop to thrash. Also as I understand that for auto-complete in LLVM, Linux is not the best place to be. Also, thanks for the Doxygen-generated docs link.<br>
>> >>>><br>
>> >>>> Warm regards,<br>
>> >>>><br>
>> >>>><br>
>> >>>> If you're more vim/emacs than IDE - I use <a href="https://wiki.archlinux.org/index.php/Vim/YouCompleteMe" rel="noreferrer" target="_blank">https://wiki.archlinux.org/index.php/Vim/YouCompleteMe</a> and compile_commands.json generated from the ninja build I think (maybe it's generated by cmake? I forget)<br>
>> >>>><br>
>> >>>><br>
>> >>>> Deep<br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>> On Tue, Jan 12, 2021 at 10:03 AM Craig Topper <<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a>> wrote:<br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>> On Mon, Jan 11, 2021 at 8:07 PM Stefanos Baziotis via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
>> >>>><br>
>> >>>> Hi Deep,<br>
>> >>>><br>
>> >>>> 1) Kind of. There's Doxygen generated from source automatically, which shows you many things e.g., members of a type along with some short documentation (which is taken from the code). It also shows you the inheritance tree related to this type<br>
>> >>>><br>
>> >>>> Here's an example: <a href="https://llvm.org/doxygen/classllvm_1_1LoopInfo.html" rel="noreferrer" target="_blank">https://llvm.org/doxygen/classllvm_1_1LoopInfo.html</a><br>
>> >>>><br>
>> >>>> It doesn't really matter what this is for now, but you can see e.g., that LoopInfo inherits from LoopInfoBase. If you scroll down, you can click to different members and go to a more detailed description further down. You can open the dropdown menus (e.g., public<br>
>> >>>><br>
>> >>>> functions inherited). And finally, at the top, you can see the file it appears at. In general, I think that if you start clicking stuff, it's going to make sense, it's relatively intuitive.<br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>> 2) Try minimizing the number of parallel threads used. I think by default Ninja uses all the available threads which in most machines will fill up the RAM. To limit them, use the -j argument like this: ninja -j8<br>
>> >>>><br>
>> >>>> Another thing that will probably be useful in general is that you can choose to build specific sub-projects instead of building the whole thing, like this: ninja -j8 opt<br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>> You can also use -DLLVM_PARALLEL_LINK_JOBS=<number> on your cmake command to limit just the number of linking jobs that can run in parallel. -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON can be a useful build configuration that you gets you debug logging and assertions, but you won't have debug symbols for gdb. There's also -DLLVM_USE_SPLIT_DWARF. All of these options are covered here <a href="https://llvm.org/docs/GettingStarted.html#common-problems" rel="noreferrer" target="_blank">https://llvm.org/docs/GettingStarted.html#common-problems</a><br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>> 3) Ok, first of all, if you only care about editing and not debugging LLVM (i.e. launching it with a debugger like gdb), then editors like Vim, Emacs, 4coder, maybe Sublime Text should do the job. I think most people<br>
>> >>>><br>
>> >>>> developing LLVM on Linux use something like this.<br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>> Now, if you're interested in IDEs and / or debuggers, well, the news in Linux is bad IMHO. For example, in my machine, GDB takes _30 seconds_ to launch the debug build of opt.<br>
>> >>>><br>
>> >>>> So, I couldn't use any IDE because virtually all use GDB under the hood. Personally, I switched to Windows + Visual Studio just for this reason. That was an insane productivity boost for me.<br>
>> >>>><br>
>> >>>> But if you need something that works in Linux, you can maybe try LLDB. Hopefully it will be faster. If yes, you can maybe try hooking it in an IDE, which I guess won't be trivial.<br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>> That said, as I don't develop LLVM in Linux, other people might have better suggestions.<br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>> Best,<br>
>> >>>><br>
>> >>>> Stefanos<br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>> Στις Τρί, 12 Ιαν 2021 στις 5:43 π.μ., ο/η Deep Majumder via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> έγραψε:<br>
>> >>>><br>
>> >>>> Hello everyone,<br>
>> >>>><br>
>> >>>> I have been studying the LLVM IR and now want to get into LLVM development. I have a few questions regarding that and I would be really grateful to get answers for:<br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>> 1) The LangRef is an excellent guide/reference to the IR. Is there something similar for the codebase (the core llvm to be specific)? Or do I have to generate that from the source, in which case how do I do that?<br>
>> >>>><br>
>> >>>> 2) I tried building just the llvm sub-project, and that is filling up my RAM completely during the linking stages, and sends my laptop thrashing. I am using Ninja. Is there a way to mitigate this? (I am on Ubuntu 20.04 Linux, 8 GM RAM, 8 GM swap on an HDD).<br>
>> >>>><br>
>> >>>> 3) VSCode, at least on my laptop, is very sluggish with such large a project. Is there any recommended development environment for Linux (or at least something that has been found to work well)?<br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>> Thank you for your time!<br>
>> >>>><br>
>> >>>> Regards,<br>
>> >>>><br>
>> >>>> Deep<br>
>> >>>><br>
>> >>>> _______________________________________________<br>
>> >>>> LLVM Developers mailing list<br>
>> >>>> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
>> >>>> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
>> >>>><br>
>> >>>> _______________________________________________<br>
>> >>>> LLVM Developers mailing list<br>
>> >>>> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
>> >>>> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
>> >>>><br>
>> >>>> _______________________________________________<br>
>> >>>> LLVM Developers mailing list<br>
>> >>>> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
>> >>>> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
>> >>>><br>
>> >>>> _______________________________________________<br>
>> >>>> LLVM Developers mailing list<br>
>> >>>> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
>> >>>> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>> --<br>
>> >>>><br>
>> >>>> Disclaimer: Views, concerns, thoughts, questions, ideas expressed in this mail are of my own and my employer has no take in it.<br>
>> >>>><br>
>> >>>> Thank You.<br>
>> >>>> Madhur D. Amilkanthwar<br>
>> >>><br>
>> >>> _______________________________________________<br>
>> >>> LLVM Developers mailing list<br>
>> >>> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
>> >>> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>