Jonathan:
Thanks for the response. Your advise on breaking up the build
fixed the problem.
Question: With gcc is there an upper limit on the object code
size of the final linked application? How about the *.O files?
Currently I am at about 50.5MB.
Currently I use static linking for portability, avoiding missing
dll issues.
For larger applications will it be necessary to break up the
executable using
dynamic link libraries, thus loading a block when and if it is actually
called?
Thomas Dineen
On 8/22/2015 1:46 AM, Jonathan Wakely wrote:
On 22 August 2015 at 07:19, Thomas Dineen wrote:
Gentle People:
When Building a rather large project gcc produces the following error:
"Out of memory for code representation:" See the details below.
What is the best or simplest way to fix this?
1) Will using 64 bit via the -m64 flag fix this?
That tells the compiler to produce 64-bit output, it doesn't change
how much memory it has available, and is likely to use more memory to
represent the larger pointer types.
or
2) I am currently building the project with single gcc call. (The slow way)
Due to some legacy issues with GTK/Cairo and extern variables one big build
seems to work. Would it be better to compile each .C File to a .O file and
then
link (Faster way).
Do you mean you've put all the code in a single file? If yes, then of
course splitting it up into smaller files will use less memory.
3) I am using an older gcc 3.4.6 on Solaris 10.
Good grief.
Sun5# !ma
make TA_Benchs
Running Target: TA_Bench Sun
gcc -D_REENTRANT -ggdb -w -g -c IB_TWS_API.c Read_IB_Callbacks.c
gcc Main.c -ggdb -w IB_TWS_API.o Read_IB_Callbacks.o `pkg-config --cflags
--libs gtk+-2.0 ` -lcurl -lm -lsocket -lnsl -ggdb -w -o TA_Bench.sun
Assembler: Main.c
"/var/tmp//ccVeiKcL.s", line 15324105 : Out of memory for code
representation
make: *** [TA_Benchs] Error 1
This error isn't even coming from GCC, it's coming from the assembler,
which is part of Solaris and not part of GCC. It's trying to assemble
a file that is at least 15 million lines long. That's probably your
problem. Try splitting Main.c into smaller files.