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

Nikola Smiljanic popizdeh at gmail.com
Mon Jan 21 18:27:53 PST 2013


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
>



More information about the cfe-dev mailing list