From: antonio_duran@hotmail.com (Antonio Duran)
Subject: Re: binary size
Date: 5 Jun 2002 00:37:41 -0700
Date: 2002-06-05T07:37:42+00:00 [thread overview]
Message-ID: <e1a50f2.0206042337.6d2ba180@posting.google.com> (raw)
In-Reply-To: zsaL8.46033$wj7.16287732@twister.socal.rr.com
On SuSE Linux 8.0 using gnat 3.13p the size of the resulting
executable invoking gnatmake with no additional parameters is 19,9K.
Antonio Duran
"Peter Bui" <peterbui@mybox.cc> wrote in message news:<zsaL8.46033$wj7.16287732@twister.socal.rr.com>...
> I faced this problem too, but after some messing around, I found a way to
> reduce the executable file size. Try:
>
> gnatmake -O2 -fno-inline --GNATBIND='gnatbind -shared' sourcefile.adb
>
> Replace sourcefile.adb with your file. The key here is the
> "--GNATBIND='gnatbind -shared' ", which tells the compiler to use the shared
> library rather than the static. I'm not sure if the "-O2" or the
> "-fno-inline" really do much, but I haven't really experimented too much
> with them.
>
> Anyways, after you compile using the line above you should get an executable
> about ~15 kb or something in that neighborhood. To further reduce the
> executable filesize, run:
>
> strip executable
>
> using this I have been able to get a simple Hello World program down to ~6kb
> which is a significant reduction.
>
> BTW, I am using Gnat 3.14p on Linux
> Good Luck!
>
> "Alexei A. P." <apolkhanov@novus-tele.net> wrote in message
> news:al_K8.117776$%o.11491889@bin3.nnrp.aus1.giganews.com...
> > Given two programs one in C another in Ada95. Simple "HEllo world" program
> > takes as much as 300K !, same time C program with same functionality only
> > 14K .
> > Looking at symbol table of both executables I can see that Ada runtime
> > consumes 90
> > % of it, then I've got a simple question: Can I move this part into one
> > shared module ? I
> > am using GNAT on Linux and I am wondering if this is a right way to go ?
> > Posibly there is
> > another, standard, way to make runtime libraries shared ? And Should
> things
> > like Text_IO
> > be included in it as well ?
> >
> > Alexei.
> >
> >
> >
> >
> >
> >
> >
> >
> >
prev parent reply other threads:[~2002-06-05 7:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-04 7:52 binary size Alexei A. P.
2002-06-04 10:45 ` Jacob Sparre Andersen
2002-06-04 21:39 ` Peter Bui
2002-06-05 7:37 ` Antonio Duran [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox