comp.lang.ada
 help / color / mirror / Atom feed
* huge executable
@ 2000-05-14  0:00 Randy
  2000-05-14  0:00 ` Robert Dewar
  2000-05-14  0:00 ` Robert Dewar
  0 siblings, 2 replies; 5+ messages in thread
From: Randy @ 2000-05-14  0:00 UTC (permalink / raw)


The GNAT Ada compiler embeds code for the "Runtime Environment" (RTE) with
every program.  The RTE is (kind of) like the Java Virtual Machine.  It
doesn't translate bytecode but works with the O/S and your executable for
things like multi-tasking.  There is more in the Ada Ref Manual and I'm sure
someone else in this group knows more than I.  There is another compiler
called GNORT (Gnu with NO Run Time) that will not link in the RTE.
Honestly, though, for a large program the overhead of the RTE becomes
negligible.  Hope this helps...
                        Randy


----- Original Message -----
From: David Dousette <david.dousette@mailandnews.com>
Newsgroups: comp.lang.ada
Sent: Saturday, May 13, 2000 7:04 PM
Subject: huge executable??


> I'm using the OS/2 version of GNAT 3.12p, and as I'm still new to Ada, I
> thought I'd take a stab at a "Hello World!" program, without my handy
> book... got it on the second try, stupid semicolon... anyway, my
> question was why is the executable so large?  Here's the code:
>
> --------------------------------------------------------------------
> with Ada.Text_IO;
>
> procedure Hello is
>
> begin
>     Ada.Text_IO.Put("Hello World!");
>     Ada.Text_IO.Flush;
> end Hello;
> --------------------------------------------------------------------
>
> I compiled it with the command line "gnatmake hello.adb" and the
> executable generated was a little over 250,000 bytes!  I ran it through
> "emxbind -s" (as suggested by R. Dewar) to strip out all the debugging
> stuff, but it's still 126,000 bytes.... why?  I wrote a similar program
> in C, and it was less than 5,000 bytes... why is the .EXE produced by
> Ada so much bigger?  The executable runs fine, and I have plenty of hard
> drive space... I was just curious.
>
> Thanks,
> David
>






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

* Re: huge executable
  2000-05-14  0:00 huge executable Randy
@ 2000-05-14  0:00 ` Robert Dewar
  2000-05-14  0:00   ` David Dousette
  2000-05-14  0:00 ` Robert Dewar
  1 sibling, 1 reply; 5+ messages in thread
From: Robert Dewar @ 2000-05-14  0:00 UTC (permalink / raw)


In article <shtc8b85je440@corp.supernews.com>,
  "Randy" <randypugh@redshift.com> wrote:

> The GNAT Ada compiler embeds code for the "Runtime
> Environment" (RTE) with every program.

Note that this is true by default on some targets, and false
by default on some targets (where dynamic libraries are the
default, e.g. SGI), and on some targets, the user can choose
whether to use static or dynamic linking.

On OS/2, where the question originates, the default is to
link statically, but OS/2 most certainly supports dynamic
linking, so it would be possible to build the GNAT runtime
as a dynamic shared library (although we do not provide this
by default).

Robert Dewar
Ada Core Technologies


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: huge executable
  2000-05-14  0:00 huge executable Randy
  2000-05-14  0:00 ` Robert Dewar
@ 2000-05-14  0:00 ` Robert Dewar
  1 sibling, 0 replies; 5+ messages in thread
From: Robert Dewar @ 2000-05-14  0:00 UTC (permalink / raw)


In article <shtc8b85je440@corp.supernews.com>,
  "Randy" <randypugh@redshift.com> wrote:

> The GNAT Ada compiler embeds code for the "Runtime
> Environment" (RTE) with every program.

Note that this is true by default on some targets, and false
by default on some targets (where dynamic libraries are the
default, e.g. SGI), and on some targets, the user can choose
whether to use static or dynamic linking.

On OS/2, where the question originates, the default is to
link statically, but OS/2 most certainly supports dynamic
linking, so it would be possible to build the GNAT runtime
as a dynamic shared library (although we do not provide this
by default).

Robert Dewar
Ada Core Technologies


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: huge executable
  2000-05-14  0:00 ` Robert Dewar
@ 2000-05-14  0:00   ` David Dousette
  2000-05-14  0:00     ` Robert Dewar
  0 siblings, 1 reply; 5+ messages in thread
From: David Dousette @ 2000-05-14  0:00 UTC (permalink / raw)


Is this a command line switch I could specify for GNATMAKE to use
dynamic linking versus static?  Or were you saying that this is
something in how GNAT itself was written or compiled?  And what would
the advantages be, provided the target OS supports both, of using static

linking over dynamic linking?

Thanks!
David

Robert Dewar wrote:

> In article <shtc8b85je440@corp.supernews.com>,
>   "Randy" <randypugh@redshift.com> wrote:
>
> > The GNAT Ada compiler embeds code for the "Runtime
> > Environment" (RTE) with every program.
>
> Note that this is true by default on some targets, and false
> by default on some targets (where dynamic libraries are the
> default, e.g. SGI), and on some targets, the user can choose
> whether to use static or dynamic linking.
>
> On OS/2, where the question originates, the default is to
> link statically, but OS/2 most certainly supports dynamic
> linking, so it would be possible to build the GNAT runtime
> as a dynamic shared library (although we do not provide this
> by default).
>
> Robert Dewar
> Ada Core Technologies
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.





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

* Re: huge executable
  2000-05-14  0:00   ` David Dousette
@ 2000-05-14  0:00     ` Robert Dewar
  0 siblings, 0 replies; 5+ messages in thread
From: Robert Dewar @ 2000-05-14  0:00 UTC (permalink / raw)


In article <391EF7AD.8BDC88B8@mailandnews.com>,
  David Dousette <david.dousette@mailandnews.com> wrote:
> Is this a command line switch I could specify for GNATMAKE to
use
> dynamic linking versus static?

Check the documentation ... it varies from target to target. Or

> And what would the advantages be, provided the target OS
> supports both, of using static

Nothing special about this situation, all the usual
considerations between static and dynamic linking apply
in the usual manner (i.e. this is not an Ada or GNAT
related question).


Sent via Deja.com http://www.deja.com/
Before you buy.




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

end of thread, other threads:[~2000-05-14  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-14  0:00 huge executable Randy
2000-05-14  0:00 ` Robert Dewar
2000-05-14  0:00   ` David Dousette
2000-05-14  0:00     ` Robert Dewar
2000-05-14  0:00 ` Robert Dewar

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