gm2
[Top][All Lists]
Advanced

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

Re: [Gm2] Minimal libraries


From: Gaius Mulley
Subject: Re: [Gm2] Minimal libraries
Date: Sat, 27 Jun 2009 14:46:45 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

address@hidden writes:

> Gnu C, Gnu C++, and Critical Mass Modula 3 all produce "hello world"
> binaries of 6-8Kb stripped, where Gnu Modula 2 produces 110Kb stripped.
> I doubt that the differences are due to lack of link time optimisations,
> tho' they may be.  Anyway, thanks.
>
> Will

Hi,

C, C++ and gm2 all use the same middle and backend.  The difference is
the way the libraries are organised.  For example glibc is composed of
6244 C files, most of which consist of one function per object, thus
when linking against glibc.a the linker pulls in only an object
matching a function, (hence a pretty minimal binary).  However gm2
produces an object per implementation module, typically containing
many procedures.  Thus the linker will drag in the whole object file
even if only one procedure is used.

  In gm2 we could get the same effect if we were to only use one
procedure in every implementation module, though this is a non
runner..  However the LTO is best solution as it works for huge
projects and will be scalable.  Another solution is for cc1gm2 to
parse the whole Modula-2 project and generate a single object file
containing only those entities required directly and indirectly by
main.

regards,
Gaius




reply via email to

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