ld.lld goes out of memory

Ronald Klop ronald-lists at klop.ws
Sun Nov 25 18:52:30 UTC 2018


On Sun, 25 Nov 2018 06:45:26 +0100, Mark Millard <marklmi at yahoo.com> wrote:

> On 2018-Nov-24, at 19:35, Ed Maste <emaste at reebsd.org> wrote:
>
>> On Sat, 24 Nov 2018 at 14:49, Ronald Klop <ronald-lists at klop.ws> wrote:
>>>
>>> Hello,
>>>
>>> While compiling databases/mongodb34 on my RPI3B+ 12.0-RC1/arm64 ld.lld
>>> fails often because of 'out of swap' or other issues about memory
>>> shortage. Is this something others experience on "low memory" machines?
>>> ...
>>> -bool lld::ThreadsEnabled = true;
>>> +bool lld::ThreadsEnabled = false;
>>
>> Note that lld has a --no-threads flag that should achieve the same
>> thing without a compile-time change.
>
> When I looked into it earlier I did not find a ports
> equivalent of the buildworld buildkernel global
> control via, say,
>
> LDFLAGS.lld+=-Wl,--no-threads


That was kind of my problem. Setting LDFLAGS in the ports Makefile broke  
the building at configure step. It was easier to disable threads at  
compile time of lld than to dive into the ports Makefile/scons structure.

Regards,
Ronald.


> The binutils linkers will not tolerate the option. So
> it ends up being a port-by-port adjustment as far as
> I could tell.
>
> It need not be just low memory machines: for N
> cpus, in FreeBSD terms, lld with threads enabled
> adds N+1 threads (not counting main's thread: N+2
> total). If several lld's run at once it can get to
> be a lot of threads at once in a poudriere run.
> I've observed this fanout on a 32-hardware thread
> context, so 34 threads for one lld, counting the
> main thread. And at times I've had several compiler
> toolchains building at once with multiple lld's
> running at once. (But I did happen to have
> sufficient RAM for what happened.)
>
>
> ===
> Mark Millard
> marklmi at yahoo.com
> ( dsl-only.net went
> away in early 2018-Mar)


More information about the freebsd-arm mailing list