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-Thread: 103376,6575b47ba54cee7c X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.germany.com!newsfeed1.funet.fi!newsfeeds.funet.fi!news.cc.tut.fi!not-for-mail From: Tero Koskinen Newsgroups: comp.lang.ada Subject: Re: Reducing the size of executables produced by GNAT Date: Wed, 13 Feb 2008 19:34:22 +0200 Message-ID: <20080213193422.85039cf0.tero.koskinen@iki.fi> References: <40e9c01a-8d31-4554-9d9b-18cce7834d56@s12g2000prg.googlegroups.com> NNTP-Posting-Host: ip154.otanner14.opintanner.fi Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: news.cc.tut.fi 1202924062 30184 195.148.53.154 (13 Feb 2008 17:34:22 GMT) X-Complaints-To: abuse@tut.fi NNTP-Posting-Date: Wed, 13 Feb 2008 17:34:22 +0000 (UTC) X-Newsreader: Sylpheed 2.4.5 (GTK+ 2.12.3; i386-unknown-openbsd4.2) Xref: g2news1.google.com comp.lang.ada:19775 Date: 2008-02-13T19:34:22+02:00 List-Id: On Wed, 13 Feb 2008 03:52:49 -0800 (PST) Hibou57 wrote: > I'm afraid of what it means : take long to initialize at startup ? (I > need fast application, for CGI on a Linux server), many unusefull > dependencies on external library ? etc, etc Like others suggested, look at AWS. It is a fast web server, much faster than normal http-server + CGI app combination. > to do it (strange...). I've tryed to compile with "pragma > No_Run_Time", Here is simple example which uses C runtime instead of Ada runtime for output: ==snip== pragma No_Run_Time; with Interfaces.C; use Interfaces.C; procedure Hello is procedure Puts (Str : Char_Array); pragma Import (C, Puts, "puts"); begin Puts ("Hello, World!"); end Hello; ==snip== Compile it using command: $ gnatmake -Os hello or: $ gnatmake -Os hello -largs -static (add -lc if needed) On OpenBSD/i386 with GCC 4.3 I get following sizes (after strip): -rwxr-xr-x 1 tkoskine tkoskine 5752 Feb 13 19:21 hello.dynamic -rwxr-xr-x 1 tkoskine tkoskine 75908 Feb 13 19:17 hello.static Normal hello using Ada.Text_IO and full Ada runtime: -rwxr-xr-x 1 tkoskine tkoskine 91140 Feb 13 19:32 hello.normal.dynamic -rwxr-xr-x 1 tkoskine tkoskine 210088 Feb 13 19:32 hello.normal.static On Linux system you probably get smaller binaries, because OpenBSD includes all kinds of magical buffer overflow protection stuff into binaries. But like you noticed without runtime your life gets harder. It is easier to just use full Ada runtime. My AWS binaries have been from 1.5M to 3M and you should be able to fit that on any modern system with a network connection. -- Tero Koskinen - http://iki.fi/tero.koskinen/