This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC 4.1: Buildable on GHz machines only?
- From: Ian Lance Taylor <ian at airs dot com>
- To: Joe Buck <Joe dot Buck at synopsys dot COM>
- Cc: "H. J. Lu" <hjl at lucon dot org>, Andrew Haley <aph at redhat dot com>, Alexandre Oliva <aoliva at redhat dot com>, David Edelsohn <dje at watson dot ibm dot com>, Andreas Schwab <schwab at suse dot de>, Richard Earnshaw <rearnsha at gcc dot gnu dot org>, Andrew Pinski <pinskia at physics dot uc dot edu>, Paul Koning <pkoning at equallogic dot com>, s dot bosscher at student dot tudelft dot nl, gcc at gcc dot gnu dot org, matt at 3am-software dot com, cow at compsoc dot man dot ac dot uk
- Date: 04 May 2005 12:43:46 -0400
- Subject: Re: GCC 4.1: Buildable on GHz machines only?
- References: <17009.2368.986169.753001@cuddles.cambridge.redhat.com><200504281609.j3SG9ZD27524@makai.watson.ibm.com><20050428164727.GB30649@synopsys.com><200504281654.j3SGs0D27158@makai.watson.ibm.com><oracncw0a1.fsf@livre.redhat.lsd.ic.unicamp.br><20050503220342.GA23969@synopsys.com><17016.41624.799846.161219@cuddles.cambridge.redhat.com><20050504134157.GA5261@lucon.org><20050504160005.GB26103@synopsys.com><20050504161719.GA7542@lucon.org><20050504162944.GA28196@synopsys.com>
Joe Buck <Joe.Buck@synopsys.COM> writes:
> So the basic issue is this: why the hell does the linker need so much
> memory? Sure, if you have tons available, it pays to trade memory for
> time, mmap everything, then build all the hashes you want to look up
> relationships in every direction. But if it doesn't really fit, it's
> a big lose. Ideally ld, ar and the like could detect and adapt if there
> isn't enough physical memory to hold everything.
At present the linker provides command line options --no-keep-memory
and --reduce-memory-overheads to significantly reduce the amount of
memory required during the link.
It should be possible in principle to partially adapt to available
memory based on, e.g., physmem_total. The linker could keep track of
how much memory it has allocated via bfd_alloc and bfd_malloc. If
that total gets to be 75% of physmem_total, or something like that,
the linker could switch to --no-keep-memory.
Unfortunately the decisions made by --reduce-memory-overhead apply at
the start of the link. At that time it is difficult to tell how much
memory will be needed.
Ian