comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert C. Leif" <rleif@rleif.com>
Subject: RE: Creating really small binaries?
Date: Mon, 24 Jun 2002 12:23:46 -0700
Date: 2002-06-24T12:23:46-07:00	[thread overview]
Message-ID: <mailman.1024946703.14752.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: <u1yb4zghs.fsf@gsfc.nasa.gov>

From: Bob Leif
To: Stephen Leake et al.
An Ada J code compiler may produce smaller executables.

-----Original Message-----
From: comp.lang.ada-admin@ada.eu.org
[mailto:comp.lang.ada-admin@ada.eu.org] On Behalf Of Stephen Leake
Sent: Tuesday, June 18, 2002 9:42 AM
To: comp.lang.ada@ada.eu.org
Subject: Re: Creating really small binaries?

Caffeine Junky <nospam@hotmail.com> writes:

> I'm looking for tips on how to make my executables really tiny.

Ok.

> More specifically I'm interested in keeping the memory used by the
> running executable really small. 

Ok; that's more specific.

> I realize that much of it is determined by the compiler being
> used(GNAT, Aonix, Green Hills, etc...) and the platform(using Linux
> 2.4 here). A small executable on disk would be a nice bonus, but not
> particularly important. Since Ada has shown itself to be excellent
> for embedded systems, which normally have much less RAM(if any at
> all) than the standard PC, I'm sure that this is not much of a
> problem.

Ok.

> Now, I dont plan on linking to any shared C libs at first.(except of
> course glibc which is usually used by default with GNAT on Linux
> systems).

You can avoid glibc as well, depending on your application.

> The only problem I forsee is when it comes time to do GUI work,
> which has an unfortunate tendency to bloat things. I hope to
> overcome this by creating a limited interface directly to XLib.

Hmm, XLib is presumably a huge C library, so you've changed your mind
on that?

Writing your own GUI on top of XLib may not be the best way to make
the in-memory image size smaller. You may not be as good a GUI
programmer as the people who wrote the existing layers :). I know I'm
not!

In addition, if the GUI layers are in shared libraries, are you
counting them as part of "your" executable image size? If not, then
use as many shared libraries as possible!

> Of course there are all the standard tools such as -O2 

Or -O3, inline options, suppress checks, eliminate unused subprograms,
etc.

> and strip.

'strip' only changes the size of the executable on disk, not in ram.

> Any suggestions on where I should begin?

Define the requirements for your application. Define the features you
will need to meet those requirements. Design a system that is robust,
easy to test, and probably efficient in terms of in-memory image size.
while (not working) loop Compile it. Test it. end loop. See how big it
is. Look for places to make it smaller.

If you say more about your specific application, it might be possible
to give more precise help.

-- 
-- Stephe




  parent reply	other threads:[~2002-06-24 19:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-18  6:53 Creating really small binaries? Caffeine Junky
2002-06-18 16:41 ` Stephen Leake
2002-06-18 20:01   ` Caffeine Junky
2002-06-19 15:50     ` Stephen Leake
2002-06-24 19:23   ` Robert C. Leif [this message]
2002-06-26  8:08   ` Robert Dewar
2002-06-26 15:09     ` Stephen Leake
2002-06-28 22:34       ` Florian Weimer
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox