diff --git a/llvm/docs/GettingStarted.rst b/llvm/docs/GettingStarted.rst --- a/llvm/docs/GettingStarted.rst +++ b/llvm/docs/GettingStarted.rst @@ -1098,6 +1098,53 @@ general questions about LLVM, please consult the `Frequently Asked Questions `_ page. +If you are having problems with limited memory and build time, please try +building with ninja instead of make. Please consider configuring the +following options with cmake: + + * -G Ninja + Setting this option will allow you to build with ninja instead of make. + + * -DLLVM_ENABLE_LLD + Set this to ON to use the LLD linker. This significantly improves build time. + + * -DLLVM_USE_LINKER + Set this to gold to use the gold linker to improve performance during build. + + * -DCMAKE_BUILD_TYPE + Set this equal to the build you wish to use, either Debug or Release. The + Debug build may consume more memory during the linking phase. Another build + type you may wish to consider is release-with-asserts which compiles at + nearly the same rate as the Release build; however, it may not be as easy + to debug. + + * -DLLVM_PARALLEL_LINK_JOBS + Set this equal to number of jobs you wish to run simultaneously. This is + similar to the -j option used with make, but only for link jobs. This option + is of course only meaningful if you plan to build with ninja. + + * -DLLVM_TARGETS_TO_BUILD + Set this equal to the target you wish to build. You may wish to set this to + X86; however, you will find a full list of targets within the + llvm-project/llvm/lib/Target directory. + + * -DLLVM_OPTIMIZED_TABLEGEN + Set this to ON to generate a fully optimized tablegen during build. This will + significantly improve your build time. + + * -DLLVM_ENABLE_PROJECTS + Set this equal to the projects you wish to compile. If compiling more than one + project, deliniate the list with a semicolon. Should you run into issues with + the semicolon, surround it with single quotes. + + * -DCLANG_ENABLE_STATIC_ANALYZER + Set this option to OFF if you do not require the STATIC_ANALYZER. This should + improve your build time significantly. + + * -DLLVM_USE_SPLIT_DWARF + Consider setting this to ON if you require a debug build, as this will ease + memory pressure on the linker. + .. _links: Links