[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Compiling with gcc



On Wed, 2005-10-19 at 09:06 -0700, Nicholas Steele wrote:
> Hi,
> I have just started using gcc and I can't get it to compile even a 
> "Hello world" program; it gives a memory error when linking. My setup is:
> TT with 8MB ram (4 ST/ 4 TT)
> freemint 1.15.12
> gcc 2.95.3
> When I run the free command it reports just over 5MB of free ram available.
> I start gcc with:
> 
> gcc -v -Wall -Wa,-m68030 -o foo foo.c
> 
> and the last output is:
> 
>    as -m68000 -m68030 -o /tmp/ccQ8hzP6.o /tmp/ccExCNoA.s 
> /usr/lib/gcc-lib/m68k-atari-mint/2.95.3/collect2 -o foo /usr/lib/crt0.o 
> -L/usr/lib/gcc-lib/m68k-atari-mint/2.95.3 /tmp/ccQ8hzP6.o -lgcc -lc -lgcc
> /usr/lib/libc.a: could not read symbols: Memory exhausted
> collect2: ld returned 1 exit status
> 
> Any help is appreciated.
> 
> Nicholas Steele
> 
> 

This is not a surprise.  You need more than this most likely.  GCC is a
true ram hog.  In some cases G++ can consume over 100MB of ram compiling
a very simply C++ file.  If you have a PC consider aranym and easymint
for compiling or consider cross compiling on a linux pc.  

Since this particular issue is a linker memory issue, there's one way
you might be able to get around it.  

Try:

       -no-keep-memory
              The linker normally optimizes for speed over memory
              usage by caching the symbol tables of  input  files
              in memory.  This option tells the linker to instead
              optimize for memory usage, by rereading the  symbol
              tables  as  necessary.  This may be required if the
              linker runs out of memory  space  while  linking  a
              large executable.


Thanks,
Mark