gm2
[Top][All Lists]
Advanced

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

Re: [Gm2] Gnu Modula-2 binary size.


From: Gaius Mulley
Subject: Re: [Gm2] Gnu Modula-2 binary size.
Date: Tue, 19 May 2009 17:24:26 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

address@hidden writes:

> The C program:
>
> #include <stdio.h>
> int main(void { puts("hello world"); return 0; }
>
> produces, when compiled with gcc, a stripped binary of about 10KB.
>
> The equivalent gm2 program, the "hello world" example, produces a
> stripped binary of around 100KB, although hello.o is only 3.5KB.
>
> Is there any way of reducing the size of gm2 binaries, and is the
> problem documented anywhere?
>
> Many thanks - Will

Hi Will,

I'm just about to commit some changes which will build the minimal
libraries by default.  These can be accessed through the -flibs=min.
Currently a null hello.mod (without any WriteString, WriteLn)
generates a 20KB a.out.  The only M2 modules included are: libc,
M2RTS, SYSTEM and hello.  I'm confident this can be reduced
dramatically if -flibs=min also were to generate a C initialisation
program, rather than the C++ initialisation one at present.  This was
the behaviour a year ago (without exceptions).  I think this should be
retrofitted as it is a show stopper for some embedded chips..

regards,
Gaius




reply via email to

[Prev in Thread] Current Thread [Next in Thread]