You can use `LLVM_USE_LINKER=lld` CMake variable to adopt LLD (to build LLVM). And yes, LLD takes less memory and runs faster. Here are some other tips to save memory: 1. You can use `LLVM_PARALLEL_LINK_JOBS=N` (also a cmake variable) to limit the amount of parallel linker jobs to save some memory. 2. Build libraries as shared library via `BUILD_SHARED_LIBS=ON` CMake variable can dramatically speed up the linking time and save you some memory. 3. Since you’re building a Debug build (and you’re building on Linux), `LLVM_USE_SPLIT_DWARF` can dramatically reduce the size of debug info, which, to some extend, also save you some memory during link time. Best, -Min> On Apr 15, 2021, at 1:05 PM, pawel k. via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hello, > Im trying to build trunk clang in debug version on oldish ubuntu with low mem. Linking lli takes ages and fails on low mem. Is there a chance building would succeed if i used lld instead of ld? If so is there an option either to force lld or whole clang toolchain use in cmake instead of default gcc (both gcc and clang are avail on system)? Otherwise I think ill stick with release. > > Best regards, > Pawel Kunio > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Another way to save disk space and memory would be to build the Release configuration, and add `-DCMAKE_C_FLAGS=-g1 -DCMAKE_CXX_FLAGS=-g1` The `-g1` means you get debug info for line numbers, although not really types and variables; but this is enough for symbolized backtraces after a crash or assertion. This is what I use normally. --paulr> -----Original Message----- > From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Min-Yih Hsu > via llvm-dev > Sent: Thursday, April 15, 2021 5:37 PM > To: pawel.kunio at gmail.com > Cc: llvm-dev at lists.llvm.org > Subject: Re: [llvm-dev] Pardon the newbie question > > You can use `LLVM_USE_LINKER=lld` CMake variable to adopt LLD (to build > LLVM). And yes, LLD takes less memory and runs faster. Here are some other > tips to save memory: > 1. You can use `LLVM_PARALLEL_LINK_JOBS=N` (also a cmake variable) to > limit the amount of parallel linker jobs to save some memory. > > 2. Build libraries as shared library via `BUILD_SHARED_LIBS=ON` CMake > variable can dramatically speed up the linking time and save you some > memory. > > 3. Since you’re building a Debug build (and you’re building on Linux), > `LLVM_USE_SPLIT_DWARF` can dramatically reduce the size of debug info, > which, to some extend, also save you some memory during link time. > > Best, > -Min > > On Apr 15, 2021, at 1:05 PM, pawel k. via llvm-dev <llvm- > dev at lists.llvm.org> wrote: > > > > Hello, > > Im trying to build trunk clang in debug version on oldish ubuntu with > low mem. Linking lli takes ages and fails on low mem. Is there a chance > building would succeed if i used lld instead of ld? If so is there an > option either to force lld or whole clang toolchain use in cmake instead > of default gcc (both gcc and clang are avail on system)? Otherwise I think > ill stick with release. > > > > Best regards, > > Pawel Kunio > > _______________________________________________ > > LLVM Developers mailing list > > llvm-dev at lists.llvm.org > > https://urldefense.com/v3/__https://lists.llvm.org/cgi- > bin/mailman/listinfo/llvm-dev__;!!JmoZiZGBv3RvKRSx!ta_FURsYjV22Mf_11nioL- > 1WoGxYffvrC81QhwlPVI--_YkhJyoS4dEzUAzddJdt3w$ > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://urldefense.com/v3/__https://lists.llvm.org/cgi- > bin/mailman/listinfo/llvm-dev__;!!JmoZiZGBv3RvKRSx!ta_FURsYjV22Mf_11nioL- > 1WoGxYffvrC81QhwlPVI--_YkhJyoS4dEzUAzddJdt3w$
Hiya, Enormous thanks for all suggests and extensive too. Testing splitdwarf asap. Makes me think what i thought previously. We need dwarf go pdbish way. Separate dblike possibly adressable by url. I was hacking pdb techno before it got sexy. I know a bit how it is organized and could try to help with architecting or designing such solution. Loved dbinfo on vstudio. Gdbish not so much. And i was slaving on my corpo cotton plantation passively using gdb for about a decade. If catches anyones focus, lets discuss the solution. Best regards, Pawel Kunio czw., 15.04.2021, 23:37 użytkownik Min-Yih Hsu <minyihh at uci.edu> napisał:> You can use `LLVM_USE_LINKER=lld` CMake variable to adopt LLD (to build > LLVM). And yes, LLD takes less memory and runs faster. Here are some other > tips to save memory: > 1. You can use `LLVM_PARALLEL_LINK_JOBS=N` (also a cmake variable) to > limit the amount of parallel linker jobs to save some memory. > > 2. Build libraries as shared library via `BUILD_SHARED_LIBS=ON` CMake > variable can dramatically speed up the linking time and save you some > memory. > > 3. Since you’re building a Debug build (and you’re building on Linux), > `LLVM_USE_SPLIT_DWARF` can dramatically reduce the size of debug info, > which, to some extend, also save you some memory during link time. > > Best, > -Min > > On Apr 15, 2021, at 1:05 PM, pawel k. via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > > > > Hello, > > Im trying to build trunk clang in debug version on oldish ubuntu with > low mem. Linking lli takes ages and fails on low mem. Is there a chance > building would succeed if i used lld instead of ld? If so is there an > option either to force lld or whole clang toolchain use in cmake instead of > default gcc (both gcc and clang are avail on system)? Otherwise I think ill > stick with release. > > > > Best regards, > > Pawel Kunio > > _______________________________________________ > > 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/20210415/0cc3679e/attachment.html>