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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,cb92bb56dabee99a,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!x1g2000yqb.googlegroups.com!not-for-mail From: milouz Newsgroups: comp.lang.ada Subject: gnat : descendents of package System may not be compiled error Date: Mon, 23 May 2011 08:34:19 -0700 (PDT) Organization: http://groups.google.com Message-ID: <88d0df80-7887-4610-a3c6-9082678d8130@x1g2000yqb.googlegroups.com> NNTP-Posting-Host: 82.124.213.230 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1306164860 7336 127.0.0.1 (23 May 2011 15:34:20 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 23 May 2011 15:34:20 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: x1g2000yqb.googlegroups.com; posting-host=82.124.213.230; posting-account=2RsWdAoAAACKmfJMpyMjxrxuBA0nNyCZ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.68 Safari/534.24,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:20353 Date: 2011-05-23T08:34:19-07:00 List-Id: Hi, I'm pretty new with Ada programming and I have a little problem. I want to write a very small kernel. So, I can't use the standard adainclude and adalib. Then, I created my own include directory (named sys/). I put in it some very few packages : $ ls sys/ ada.ads a-unccon.ads interfac.ads s-expint.adb s-expint.ads s- stoele.adb s-stoele.ads system.ads And everything compiled and worked fine. But then, I created a function that use the exponentiation '**' operator. But now, when I try to compile my kernel : $ make ... $ gcc -m32 -gnato -gnatf -fstack-check -nostdinc -nostdlib -Isys/ -c lib.adb lib.adb:24:33: run-time library configuration error lib.adb:24:33: file s-expint.ads not found lib.adb:24:33: entity "System.Exp_Int.Exp_Integer" not available compilation abandoned Ok, gnat complains about a missing lib. It's a bit odd that '**' needs a lib to be implemented !!! Anyway, I copy s-expint.ad* in sys/ directory (which contains runtime library suitable for my kernel) : $ cp /opt/gcc-4.4.5/lib/gcc/x86_64-unknown-linux-gnu/4.4.5/32/ adainclude/s-expint* sys/ $ gcc -m32 -gnato -gnatf -fstack-check -nostdinc -nostdlib -Isys/ -c lib.adb $ ld -m elf_i386 --oformat binary -Ttext 1000 -e_ada_kernel kernel.o video.o exceptions.o lib.o -o kernel lib.o: In function `lib__integer_to_ascii': lib.adb:(.text+0x1e4): undefined reference to `system__exp_int__exp_integer' Mmmh.... the linker can't find Exp_Integer function which is defined in sys/s-expint.adb. I logicaly have to compile it to generate a .o object with the `system__exp_int__exp_integer' function. $ gcc -m32 -gnato -gnatf -fstack-check -nostdinc -nostdlib -Isys/ -c sys/s-expint.adb s-expint.adb:32:01: descendents of package System may not be compiled Another error ! But now, it looks like a dead end as Gnat don't want me to compile it with no other reason than the package name !!! A kludge is to define that function in another package and to export it via that kind of pragma : pragma Export(C, my_exp_int, "system__exp_int__exp_integer"). But redefining that function in another package is really ugly. Perhaps there's something I missed, but if someone have an explanation and a solution, it would be very great :-) Regards,