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: a07f3367d7,b2796c9ed44bd3f5,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.velia.net!noris.net!nntp.ilk.net!not-for-mail From: Markus Schoepflin Newsgroups: comp.lang.ada Subject: Static linking Date: Fri, 07 Aug 2009 09:54:00 +0200 Organization: Customer of ILK Internet GmbH, Karlsruhe, Germany Message-ID: NNTP-Posting-Host: csdc.comsoft.de Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: nntp.ilk.net 1249631640 18523 212.86.205.70 (7 Aug 2009 07:54:00 GMT) X-Complaints-To: usenet@ilk.net NNTP-Posting-Date: Fri, 7 Aug 2009 07:54:00 +0000 (UTC) User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) Xref: g2news2.google.com comp.lang.ada:7644 Date: 2009-08-07T09:54:00+02:00 List-Id: Hello, up to now (gcc-4.3.x) we have been happily using 'gnatmake ... -largs -static' to create statically linked executable. This has stopped working with 4.4: > touch foo.adb && gnatmake foo -largs -static gcc-4.4 -c foo.adb gnatbind -x foo.ali gnatlink foo.ali -static /usr/bin/ld: cannot find -lgnat-4.4 collect2: ld returned 1 exit status gnatlink: error when calling /usr/bin/gcc-4.4 gnatmake: *** link failed. Now I have been told that -static is a binder, not a linker argument, and indeed this works: > touch foo.adb && gnatmake foo -bargs -static gcc-4.4 -c foo.adb gnatbind -static -x foo.ali gnatlink foo.ali But this is not a static executable: > ldd foo linux-gate.so.1 => (0xb7f9e000) libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7e2d000) /lib/ld-linux.so.2 (0xb7f9f000) Looking at the manual for the binder I'm told: '-static Link against a static GNAT run time.'. OK, so this works as advertised, no dynamic GNAT runtime used. Now what is the correct way to created a static executable? This seems to work, but is it correct? > touch foo.adb && gnatmake foo -bargs -static -largs -static gcc-4.4 -c foo.adb gnatbind -static -x foo.ali gnatlink foo.ali -static > ldd foo not a dynamic executable And why did only passing '-largs -static' work for gcc-3.3.x? Markus