comp.lang.ada
 help / color / mirror / Atom feed
* Executable size with GNAT for Windows and Linux
@ 2002-05-05 19:58 Michael Bode
  2002-05-06  0:44 ` Robert Dewar
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Michael Bode @ 2002-05-05 19:58 UTC (permalink / raw)


I've found the size of executables to differ considerably under
Windows and Linux.  The hello.adb that comes with gnat 3.13p has under
Linux this size:

gnatmake -g hello.adb

-rwxr-xr-x    1 mb       users       23199 Mai  5 21:43 hello
-rw-r--r--    1 mb       users         899 Jun 12  2000 hello.adb
-rw-r--r--    1 mb       users         689 Mai  5 21:43 hello.ali
-rw-r--r--    1 mb       users        5108 Mai  5 21:43 hello.o
-rw-r--r--    1 mb       users          12 Jun 12  2000 hello.rsp

whereas under Windows

-rwxr-xr-x    1 root     root          899 Feb 25  2000 hello.adb
-rwxr-xr-x    1 root     root          720 Mai  5 10:08 hello.ali
-rwxr-xr-x    1 root     root       118306 Mai  5 10:08 hello.exe
-rwxr-xr-x    1 root     root         4751 Mai  5 10:08 hello.o
-rwxr-xr-x    1 root     root           12 Feb 25  2000 hello.rsp

Any hints what can be done to reduce executable size under Windows?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Executable size with GNAT for Windows and Linux
  2002-05-05 19:58 Executable size with GNAT for Windows and Linux Michael Bode
@ 2002-05-06  0:44 ` Robert Dewar
  2002-05-06 19:00   ` Michael Bode
  2002-05-06 10:06 ` Preben Randhol
  2002-05-06 11:41 ` David Botton
  2 siblings, 1 reply; 9+ messages in thread
From: Robert Dewar @ 2002-05-06  0:44 UTC (permalink / raw)


Michael Bode <m.g.bode@web.de> wrote in message news:<m3znzev025.fsf@jupiter.solar.system>...
> I've found the size of executables to differ considerably 
> under Windows and Linux

That's expected. Most likely you are using shared libraries under one
and not the other. The comparison is therefore
irrelevant.

Impossible to be sure, since you gave no idea of what versions of
either compiler you are running.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Executable size with GNAT for Windows and Linux
  2002-05-05 19:58 Executable size with GNAT for Windows and Linux Michael Bode
  2002-05-06  0:44 ` Robert Dewar
@ 2002-05-06 10:06 ` Preben Randhol
  2002-05-06 10:14   ` Duncan Sands
  2002-05-06 19:02   ` Michael Bode
  2002-05-06 11:41 ` David Botton
  2 siblings, 2 replies; 9+ messages in thread
From: Preben Randhol @ 2002-05-06 10:06 UTC (permalink / raw)


On 05 May 2002 21:58:42 +0200, Michael Bode wrote:
> I've found the size of executables to differ considerably under
> Windows and Linux.  The hello.adb that comes with gnat 3.13p has under
> Linux this size:
> 
> gnatmake -g hello.adb

did you compile with -g ? That would include debugging information.
Compile without -g.

Preben
-- 
"Jeg tror nordmenn har glemt hvordan de tilbreder fisk. De er mest
 opptatt av firkantet fisk."
  --  Kristian Kristiansen, yrkesfisker, aftenposten.no 19/04/02



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Executable size with GNAT for Windows and Linux
  2002-05-06 10:06 ` Preben Randhol
@ 2002-05-06 10:14   ` Duncan Sands
  2002-05-07  8:35     ` Joachim Schröer
  2002-05-06 19:02   ` Michael Bode
  1 sibling, 1 reply; 9+ messages in thread
From: Duncan Sands @ 2002-05-06 10:14 UTC (permalink / raw)


On Monday 06 May 2002 12:06 pm, Preben Randhol wrote:
> On 05 May 2002 21:58:42 +0200, Michael Bode wrote:
> > I've found the size of executables to differ considerably under
> > Windows and Linux.  The hello.adb that comes with gnat 3.13p has under
> > Linux this size:
> >
> > gnatmake -g hello.adb
>
> did you compile with -g ? That would include debugging information.
> Compile without -g.

The linker option -s strips out debugging info and some other symbols.

Duncan.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Executable size with GNAT for Windows and Linux
  2002-05-05 19:58 Executable size with GNAT for Windows and Linux Michael Bode
  2002-05-06  0:44 ` Robert Dewar
  2002-05-06 10:06 ` Preben Randhol
@ 2002-05-06 11:41 ` David Botton
  2 siblings, 0 replies; 9+ messages in thread
From: David Botton @ 2002-05-06 11:41 UTC (permalink / raw)


Try:

gnatmake -O2 XXXXX -largs -s

I also like to use UPX to compress the executable size (DLLs or even ActiveX
controls) I create with Ada.  http://upx.sourceforge.net/

David Botton


"Michael Bode" <m.g.bode@web.de> wrote in message
news:m3znzev025.fsf@jupiter.solar.system...
> I've found the size of executables to differ considerably under
> Windows and Linux.  The hello.adb that comes with gnat 3.13p has under
> Linux this size:
>
> gnatmake -g hello.adb
>
> -rwxr-xr-x    1 mb       users       23199 Mai  5 21:43 hello
> -rw-r--r--    1 mb       users         899 Jun 12  2000 hello.adb
> -rw-r--r--    1 mb       users         689 Mai  5 21:43 hello.ali
> -rw-r--r--    1 mb       users        5108 Mai  5 21:43 hello.o
> -rw-r--r--    1 mb       users          12 Jun 12  2000 hello.rsp
>
> whereas under Windows
>
> -rwxr-xr-x    1 root     root          899 Feb 25  2000 hello.adb
> -rwxr-xr-x    1 root     root          720 Mai  5 10:08 hello.ali
> -rwxr-xr-x    1 root     root       118306 Mai  5 10:08 hello.exe
> -rwxr-xr-x    1 root     root         4751 Mai  5 10:08 hello.o
> -rwxr-xr-x    1 root     root           12 Feb 25  2000 hello.rsp
>
> Any hints what can be done to reduce executable size under Windows?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Executable size with GNAT for Windows and Linux
  2002-05-06  0:44 ` Robert Dewar
@ 2002-05-06 19:00   ` Michael Bode
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Bode @ 2002-05-06 19:00 UTC (permalink / raw)


dewar@gnat.com (Robert Dewar) writes:

> That's expected. Most likely you are using shared libraries under one
> and not the other. The comparison is therefore
> irrelevant.

That's what I thought too. Both programs were built with "gnatmake -g
hello". So the question is how do I use the .dll runtime under Windows?
 
> Impossible to be sure, since you gave no idea of what versions of
> either compiler you are running.

gnat 3.13p. What other information do you need?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Executable size with GNAT for Windows and Linux
  2002-05-06 10:06 ` Preben Randhol
  2002-05-06 10:14   ` Duncan Sands
@ 2002-05-06 19:02   ` Michael Bode
  1 sibling, 0 replies; 9+ messages in thread
From: Michael Bode @ 2002-05-06 19:02 UTC (permalink / raw)


Preben Randhol <randhol+abuse@pvv.org> writes:

> did you compile with -g ? That would include debugging information.
> Compile without -g.

Both versions were compiled with -g. As Robert Dewar said I think it's
probably shared vs. nonshared libraries. But how do I use shared
libraries (for the Ada runtime system) under Windows?

-- 
begin  Outlook_is_crap.txt.vbs

Legen Sie die Diskette beschriftet mit Windows XP Professional-CD-ROM
in Laufwerk A: ein.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Executable size with GNAT for Windows and Linux
  2002-05-06 10:14   ` Duncan Sands
@ 2002-05-07  8:35     ` Joachim Schröer
  2002-05-07  8:43       ` Duncan Sands
  0 siblings, 1 reply; 9+ messages in thread
From: Joachim Schröer @ 2002-05-07  8:35 UTC (permalink / raw)


Duncan Sands wrote:

> On Monday 06 May 2002 12:06 pm, Preben Randhol wrote:
> 
>>On 05 May 2002 21:58:42 +0200, Michael Bode wrote:
>>
>>>I've found the size of executables to differ considerably under
>>>Windows and Linux.  The hello.adb that comes with gnat 3.13p has under
>>>Linux this size:
>>>
>>>gnatmake -g hello.adb
>>>
>>did you compile with -g ? That would include debugging information.
>>Compile without -g.
>>
> 
> The linker option -s strips out debugging info and some other symbols.
> 
> Duncan.
> 

That switch is not documented in the GNAT User's Guide I have
(GNAT Version 3.14p, Date: 2001/05/10 16:08:26).
When I use it one of my Exes shrinks from 15 Mb to 3.5 Mb.
But the switch eliminates the binder switch -E which generates
a readable stacktrace when using
Gnat.Traceback_Symbolic.Symbolic_Traceback.
When using -bargs -E -largs -s the generated stacktrace only
contains addresses, no filenames and linenumbers.

	J. Schr�er




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Executable size with GNAT for Windows and Linux
  2002-05-07  8:35     ` Joachim Schröer
@ 2002-05-07  8:43       ` Duncan Sands
  0 siblings, 0 replies; 9+ messages in thread
From: Duncan Sands @ 2002-05-07  8:43 UTC (permalink / raw)


On Tuesday 07 May 2002 10:35 am, Joachim Schr�er wrote:
> Duncan Sands wrote:
> > On Monday 06 May 2002 12:06 pm, Preben Randhol wrote:
> >>On 05 May 2002 21:58:42 +0200, Michael Bode wrote:
> >>>I've found the size of executables to differ considerably under
> >>>Windows and Linux.  The hello.adb that comes with gnat 3.13p has under
> >>>Linux this size:
> >>>
> >>>gnatmake -g hello.adb
> >>
> >>did you compile with -g ? That would include debugging information.
> >>Compile without -g.
> >
> > The linker option -s strips out debugging info and some other symbols.
> >
> > Duncan.
>
> That switch is not documented in the GNAT User's Guide I have
> (GNAT Version 3.14p, Date: 2001/05/10 16:08:26).
> When I use it one of my Exes shrinks from 15 Mb to 3.5 Mb.
> But the switch eliminates the binder switch -E which generates
> a readable stacktrace when using
> Gnat.Traceback_Symbolic.Symbolic_Traceback.
> When using -bargs -E -largs -s the generated stacktrace only
> contains addresses, no filenames and linenumbers.

It is in the gcc documentation (along with plenty of other usefull switches).
I once suggested to Robert Dewar (if I remember right) that -s be included
in the section on reducing the size of executables in the GNAT user guide.
Check out the program "strip" as well.  By the way, the large reduction in
size you see is almost certainly due to the removal of debugging information.
So the simplest thing to do is to compile without -g.

All the best,

Duncan.



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-05-07  8:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-05 19:58 Executable size with GNAT for Windows and Linux Michael Bode
2002-05-06  0:44 ` Robert Dewar
2002-05-06 19:00   ` Michael Bode
2002-05-06 10:06 ` Preben Randhol
2002-05-06 10:14   ` Duncan Sands
2002-05-07  8:35     ` Joachim Schröer
2002-05-07  8:43       ` Duncan Sands
2002-05-06 19:02   ` Michael Bode
2002-05-06 11:41 ` David Botton

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