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

Andre Cunha andrecunha.usp at gmail.com
Tue Jan 22 04:41:07 PST 2013


I also found it strange that ld wasn't being killed, and was instead
causing my computer to freeze. I made a "while (1) malloc(...)" test
program, and it gets killed when I run it. Very strange... I'll contact
someone from Fedora about this.

I'll also try to use gold instead of the traditional ld. Thank you for the
suggestion!


On 22 January 2013 00: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
> >
>



-- 
Andre Cunha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130122/a7218816/attachment.html>


More information about the cfe-dev mailing list