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,5bc78ee8215aaa09 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: MinGW-w64 gnatlink "undefined reference" Date: Sun, 10 Apr 2011 07:18:29 +0100 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx01.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="4777"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18d9DOCv082j3U7Fh+ZT8C/87j7NdvQZM8=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (darwin) Cancel-Lock: sha1:uLDbpUJpHw5//6G+iZifqtgPDO4= sha1:lQQAg+UhlOr0jDt9uzvahJMTC10= Xref: g2news2.google.com comp.lang.ada:19711 Date: 2011-04-10T07:18:29+01:00 List-Id: mjamesb writes: > x86_64-w64-mingw32-gnatlink helloworld.ali > /usr/lib/gcc/x86_64-w64-mingw32/4.5.2/adalib/libgnat.a(s-exctab.o): In function `system__exception_table__internal_exception': > /home/user/mingw64/mingw64-x86_64-gcc-4.5.2-1/build/gcc/ada/rts/s-exctab.adb:154: undefined reference to `__gnat_eh_personality_sj' What this is saying is that the RTS (run time system) s-exctab.o (System.Exception_Table) contains a reference which isn't satisfied. This is nothing to do with your code, it's that Ada.Text_IO calls in vast chunks of the RTS including exception handling. To see what's happening at link time, you'd need to ask for verbose linker output: - for verbose output from gnatlink (which calls up the linker): $ gnatmake helloworld.adb -largs -v - for verbose output from the linker itself: $ gnatmake helloworld.adb -largs -Wl,-v '__gnat_eh_personality_sj' is to do with the way the RTS handles exceptions. Reading between the lines in http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gnat_ugn_unw/Exception-Handling-Control.html your problem will be related to the setjmp/longjmp method, and you could try 'gnatmake helloworld.adb --RTS=zcx', but in any case there's no excuse for the default RTS to be incomplete. I think you need to take this up with whoever built your compiler.