On 6/26/19 00:25 UTC, Philip Kovacs via devel wrote:
I am finding that one of my c++ packages has compilation units that generate 
very large assembly (.s)
files -- so large that any attempt to build them in memory (e.g. with -pipe) 
causes memory exhaustion.
The only way I have found to reliably get the build to run to completion is by 
using -save-temps to force
g++ to save the .s assembly files to disk.

Please quantify: What is the byte size of the .s file?

First hint: give the virtual machine enough resources!
Either RAM, or "swap" (paging) space.

Also, -pipe itself uses at most (16 * 4KiB) more memory.
Memory (RAM) exhaustion is caused by having all the (.data+.bss)
of both the compiler and the assembler resident at the same time.
(Most of this will be the symbol table for the assembler.)
Even then, if you have enough swap space (shown by the utility program
/usr/sbin/swapon, also by /usr/bin/top | grep Swap) then compilation
will succeed, although much more slowly due to demand paging.
You can increase swap space by using one or more "instantiated"
files in the filesystem; see "man swapon".

It may be possible to use the gcc option -ffunction-sections
(possibly combined with a filter using /usr/bin/sed, etc.)
as a hint to the assembler to discard the symbols for
local labels upon reaching the end of each function.

For particular cases, you can use "gcc --verbose ...", or even
"strace -f -o strace.out -e trace=execve -s 500 gcc ...", to recover
command sequences that may be edited according to desire.
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org

Reply via email to