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 Path: g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!feeder.erje.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Reducing the size of executables produced by GNAT Date: Thu, 14 Feb 2008 07:58:55 +0100 Organization: Jacob's private Usenet server Message-ID: References: <40e9c01a-8d31-4554-9d9b-18cce7834d56@s12g2000prg.googlegroups.com> NNTP-Posting-Host: taasingegade.news.jacob-sparre.dk Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: jacob-sparre.dk 1202972341 17573 85.82.239.166 (14 Feb 2008 06:59:01 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 14 Feb 2008 06:59:01 +0000 (UTC) User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:jMUCmKCui9IOb+2rr7keco0ymjk= Xref: g2news1.google.com comp.lang.ada:19786 Date: 2008-02-14T07:58:55+01:00 List-Id: Hibou57 writes: > For a long time ago I'm looking for a way to reduce th esize of Ada > programs compiled with GNAT. Are you sure it is an important goal for your task? > With a simple Hello-World I cannot go below 45KB, which is very much > for a so simple program. I just created a 7_796 byte "Hello World" program. Without any special tricks. I suspect that you are not really aware of what the Ada.Text_IO library is supposed to do behind the scenes. There is a fair bit of accounting going on. > I'm afraid of what it means : take long to initialize at startup ? Have you tested if that is really the case? > (I need fast application, for CGI on a Linux server), If you really need a fast solution, why don't you create a stand-alone HTTP server instead? > Further more, as usualy, dynamic linking on Linux fall into many > troubles, The only one I've ever had, is that I have to recompile when I switch to the next stable version of Debian. > I need to compile it statically linked. And there, I got a simple > Hello-World which weight 120KB! I only get 110_236 bytes. > Why is it so big ? Because you link in the run-time. > What can I do ? Are there some hidden magic compiler switch to > reduce this size ? None that I know of. > What are the conscenquences of this size ? Does it execute all of > this 120KB of code before starting the application main work ? Most likely not. Greetings, Jacob -- �A corollary of Murphy's law is that duplicate information eventually becomes different information. Putting both in the same file may slow down the process, but it will not prevent it.� -- Wes Groleau