<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 22, 2017, at 10:55 AM, Nitish Srivastava <<a href="mailto:nks45@cornell.edu" class="">nks45@cornell.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><img width="0" height="0" class="mailtrack-img" alt="" style="display:flex" src="https://mailtrack.io/trace/mail/e66affa807023acfc0655f473503463bf0130a82.png?u=407906">Hi Vedant,<div class=""><br class=""></div><div class="">  Clang + llvm build together takes around 26 GB. I was curious if there are any tricks to reduce the size as I need only C and C++ languages in frontend and RISCV ISA for llvm backend. For the backend I am already passing -DLLVM_TARGETS_TO_BUILD=RISCV to generate the backend only for RISCV. I was curious if I can do something to reduce the size of the clang build.</div></div></div></blockquote><div><br class=""></div><div>Some ideas:</div><div><br class=""></div><div>1. It sounds like you might have configured a Debug build. If you don't need to debug clang, you can configure a Release build instead, which will be much smaller.</div><div><br class=""></div><span class="">2. You can enable a shared-library build to cut down on binary size (-DBUILD_SHARED_LIBS=On). That means there will be just one copy of the code from each llvm library in your build directory, instead of two.<br class=""></span><span class=""><br class=""></span><span class="">3. You can pare down the list of targets you build. Just building the "clang" target is much faster, and takes much less space, than building the full suite of llvm tools (which is what you get if you run "ninja" or "make").</span></div><div><span class=""><br class=""></span></div><div><span class="">4. If you're building a Release clang, you can use -Os or -Oz, instead of -O3 which is the default.</span></div><div><span class=""><br class=""></span></div><div><span class="">vedant<br class=""></span><span class=""><br class=""></span><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">  Thanks,</div><div class=""><br class=""></div><div class="">Best Regards,</div><div class="">Nitish</div><div class=""><br class=""><br class=""><br class="">‌</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Sep 22, 2017 at 1:47 PM, Vedant Kumar <span dir="ltr" class=""><<a href="mailto:vsk@apple.com" target="_blank" class="">vsk@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">- llvm-dev, + cfe-dev (moving off llvm-dev)<div class=""><br class=""></div><div class="">Hi Nitish,</div><div class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Sep 22, 2017, at 10:32 AM, Nitish Srivastava via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="m_3209270154627821229Apple-interchange-newline"><div class=""><div dir="ltr" class=""><img width="0" height="0" class="m_3209270154627821229mailtrack-img" alt="" style="display:flex" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"><div class="">Hi,<br class=""><br class=""> I am trying to build clang, however the build size is quite large. As clang supports non-C family languages as well ( e.g. Java, Fortran ),</div></div></div></blockquote><div class=""><br class=""></div></span><div class="">Clang does not accept Java or Fortran code. It links llvm, which has some language-specific support for calling conventions, but excising this support might not save you much in terms of binary size.</div><span class=""><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""> is there a way to turn that off during the build. I just want to have support for C and C++ and don't care about other languages.<br class=""><br class="">Is there a CMake option that needs to be set to do that??<br class=""></div></div></div></blockquote><div class=""><br class=""></div></span><div class="">What are you measuring exactly? Is it the size of the build directory, the size of the clang binary itself, or something else?</div><div class=""><br class=""></div><div class="">How small does clang need to be for your purposes?</div><div class=""><br class=""></div><div class="">vedant</div><br class=""><blockquote type="cite" class=""><div class=""><span class=""><div dir="ltr" class=""><div class=""><br class="">Thanks a lot!<br class=""><br class="">Best Regards, <br class=""><br class="">Nitish<br class=""><br class=""><br class="">‌</div></div></span>
______________________________<wbr class="">_________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/llvm-dev</a><br class=""></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>