Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Aug 2018 22:53:43 +0800
From:      blubee blubeeme <gurenchan@gmail.com>
To:        freebsd-rwg@pdx.rh.cn85.dnsmgr.net
Cc:        Dimitry Andric <dim@freebsd.org>, FreeBSD current <freebsd-current@freebsd.org>,  Brooks Davis <brooks@freebsd.org>
Subject:   Re: building LLVM threads gets killed
Message-ID:  <CALM2mEk2%2BmaqKJ5_v061gL00LmX9H46_OWc76_FHX4KNRxhg9w@mail.gmail.com>
In-Reply-To: <201808201426.w7KEQo9j074809@pdx.rh.CN85.dnsmgr.net>
References:  <ADEB4D33-A16C-427D-BE9B-1F25E591B0C7@FreeBSD.org> <201808201426.w7KEQo9j074809@pdx.rh.CN85.dnsmgr.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Aug 20, 2018 at 10:26 PM Rodney W. Grimes <
freebsd-rwg@pdx.rh.cn85.dnsmgr.net> wrote:

> > On 20 Aug 2018, at 05:01, blubee blubeeme <gurenchan@gmail.com> wrote:
> > >
> > > I am running current compiling LLVM60 and when it comes to linking
> > > basically all the processes on my computer gets killed; Chrome,
> Firefox and
> > > some of the LLVM threads as well
> > ...
> > > llvm/build % ninja -j8
> > > [2408/2473] Building CXX object
> > > lib/Passes/CMakeFiles/LLVMPasses.dir/PassBuilder.cpp.o
> > > FAILED: lib/Passes/CMakeFiles/LLVMPasses.dir/PassBuilder.cpp.o
> > > /usr/bin/c++  -DGTEST_HAS_RTTI=0 -D_DEBUG -D__STDC_CONSTANT_MACROS
> > > -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Passes
> -I../lib/Passes
> > > -Iinclude -I../include -isystem /usr/local/include -fPIC
> > > -fvisibility-inlines-hidden -Werror=date-time
> > > -Werror=unguarded-availability-new -std=c++11 -Wall -Wextra
> > > -Wno-unused-parameter -Wwrite-strings -Wcast-qual
> > > -Wmissing-field-initializers -pedantic -Wno-long-long
> > > -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor
> > > -Wstring-conversion -fdiagnostics-color -g    -fno-exceptions
> -fno-rtti -MD
> > > -MT lib/Passes/CMakeFiles/LLVMPasses.dir/PassBuilder.cpp.o -MF
> > > lib/Passes/CMakeFiles/LLVMPasses.dir/PassBuilder.cpp.o.d -o
> > > lib/Passes/CMakeFiles/LLVMPasses.dir/PassBuilder.cpp.o -c
> > > ../lib/Passes/PassBuilder.cpp
> > > c++: error: unable to execute command: Killed
> >
> > It is running out of RAM while running multiple parallel link jobs.  If
> > you are building using WITH_DEBUG, turn that off, it consumes large
> > amounts of memory.  If you must have debug info, try adding the
> > following flag to the CMake command line:
> >
> > -D LLVM_PARALLEL_LINK_JOBS:STRING="1"
> >
> > That will limit the amount of parallel link jobs to 1, even if you
> > specify -j 8 to gmake or ninja.
> >
> > Brooks, it would not be a bad idea to always use this CMake flag in the
> > llvm ports. :)
>
> And this may also fix the issues that all the small
> memory (aka, RPI*) buliders are facing when trying
> to do -j4?
>
>
> --
> Rod Grimes
> rgrimes@freebsd.org


Someone mentioned earlier that debug builds cause a lot of memory usage and
it's true that I am building with debug.
I couldn't grab the relevant text from top but the posted was after
everything settled down.
The memory situation got so bad that xserver died and I was booted to
terminal.

I saw ld.lld using up to 12GB of ram for each process, that will definitely
use up 32GB of ram.

I can't avoid building w/ debug symbols since I have to debug the program
are there any other options other than
building with only 1 thread? Reason being even when I set gmake -j1 the
problem comes just a lot later during linking
stage.

Best,
Owen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALM2mEk2%2BmaqKJ5_v061gL00LmX9H46_OWc76_FHX4KNRxhg9w>