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 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-04 14:39:44 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!Cidera!cyclone.socal.rr.com!cyclone3.kc.rr.com!news3.kc.rr.com!twister.socal.rr.com.POSTED!not-for-mail From: "Peter Bui" Newsgroups: comp.lang.ada References: Subject: Re: binary size X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: Date: Tue, 04 Jun 2002 21:39:43 GMT NNTP-Posting-Host: 24.30.172.39 X-Complaints-To: abuse@rr.com X-Trace: twister.socal.rr.com 1023226783 24.30.172.39 (Tue, 04 Jun 2002 14:39:43 PDT) NNTP-Posting-Date: Tue, 04 Jun 2002 14:39:43 PDT Organization: RoadRunner - West Xref: archiver1.google.com comp.lang.ada:25325 Date: 2002-06-04T21:39:43+00:00 List-Id: 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. > > > > > > > > >