From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e93773e4e06a263 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-05 00:37:42 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: antonio_duran@hotmail.com (Antonio Duran) Newsgroups: comp.lang.ada Subject: Re: binary size Date: 5 Jun 2002 00:37:41 -0700 Organization: http://groups.google.com/ Message-ID: References: NNTP-Posting-Host: 192.101.1.126 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1023262662 20790 127.0.0.1 (5 Jun 2002 07:37:42 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 5 Jun 2002 07:37:42 GMT Xref: archiver1.google.com comp.lang.ada:25333 Date: 2002-06-05T07:37:42+00:00 List-Id: 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" wrote in message news:... > 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." 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. > > > > > > > > > > > > > > > > > >