[cfe-dev] ld taking too much memory to link clang

Renato Golin Linaro renato.golin at linaro.org
Tue Jan 22 06:39:20 PST 2013


Gold in my case is still not helping, since I leave many programs open at
once and swap gets crazy in the last linking steps of the debug binaries...

Funny, though, that it starts swapping before it actually hits the maximum
memory, and I think that's why Linux is not killing the process just yet,
but it is flogging the usability of the desktop.

--renato


On 22 January 2013 02:27, Nikola Smiljanic <popizdeh at gmail.com> wrote:

> I had this issue while using Linux VMs and someone suggested just
> using gold instead of ld which resolved my issues. Having some swap
> space just in case is also useful.
>
> On Tue, Jan 22, 2013 at 11:16 AM, Andre Cunha <andrecunha.usp at gmail.com>
> wrote:
> > Hello;
> >
> > This is my first time compiling clang; I tried to do it in a computer
> with 4
> > GiB of RAM but no swap, and I had a problem: I checked out the latest
> > version of clang and llvm from the SVN repositories; when I ran 'make',
> the
> > computer freezed while linking clang, and I needed to do a hardware
> reset.
> >
> > After that, I ran 'make' again, this time with a process monitor, and
> > realized that when 'make' called 'ld' to generate the 'clang' executable,
> > the 'ld' process allocated memory on and on until the computer freezed.
> >
> > I searched the Web, and found someone saying that linking is a very
> > memory-hungry process
> > (http://forums.mozillazine.org/viewtopic.php?f=42&t=2300015), and that
> it's
> > necessary a big amount of swap memory in order to compile certain
> projects.
> >
> > As I never experienced such a behavior when compiling other projects, I
> > decided to ask here: is this really supposed to happen? If so, what is
> the
> > minimum requirement (in terms of virtual memory) to build clang?
> >
> > The environment was:
> > Fedora 18 (3.7.2-204.fc18.x86_64)
> > clang 3.1
> > GNU ld version 2.23.51.0.1-3.fc18 20120806
> >
> > Thanks in advance, and sorry if this is a stupid question.
> > --
> > Andre Cunha
> >
> > _______________________________________________
> > cfe-dev mailing list
> > cfe-dev at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> >
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130122/413d8cc8/attachment.html>


More information about the cfe-dev mailing list