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,4ffc4a297a9f10e0,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!f20g2000prn.googlegroups.com!not-for-mail From: deadlyhead Newsgroups: comp.lang.ada Subject: Thoughts on AdaCore maintaining GCC-incompatible GNAT sources Date: Thu, 20 Jan 2011 02:58:17 -0800 (PST) Organization: http://groups.google.com Message-ID: <62c8c6c1-6578-4e61-b68a-2c192f34aa94@f20g2000prn.googlegroups.com> NNTP-Posting-Host: 71.212.19.235 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1295521098 1685 127.0.0.1 (20 Jan 2011 10:58:18 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 20 Jan 2011 10:58:18 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f20g2000prn.googlegroups.com; posting-host=71.212.19.235; posting-account=snJuNwoAAABnc8T9lYkBlDQrDdSjOjG2 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101028 Iceweasel/3.5.15 (like Firefox/3.5.15),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:16581 Date: 2011-01-20T02:58:17-08:00 List-Id: I'm glad that AdaCore has been there making sure that we have a free software Ada compiler of the highest quality. I'm also glad that GNAT is part of GCC and all that entails. What's frustrating me, though, is the gap between the AdaCore releases of GNAT and the frontend distributed from the GCC project. I have no doubt that my desires are pretty unique: I want to target the JVM, but develop entirely on GNU/Linux. My commitment to free software in general, and my disdain for windows in particular, prevent me from just doing what's expected and using the binaries released by AdaCore. So, instead, I want to compile JGNAT from the AJIS sources that AdaCore provides. First attempt: try and compile JGNAT directly from the GCC-4.5.2 sources from which I built my running version of GNAT. What? I need libaddr2line.a? Well, crap. It's no longer part of binutils, and I'm not going to recompile AdaCore's binutils just for shits and giggles, so I patch my own sources =E0 la Ludovic Brenta for Debian GNAT. This works well, actually, and gets me past the libaddr2line.a once I've recompiled, but then I have to deal with some "cannot find Adabkend.ads" errors. I'd never seen this in the sources before. WTF? Turns out that AdaCore only uses this file in their own GNAT distribution, they don't push it down to GCC with everything else, just like they maintain their own copy of binutils. Now, for your everyday GNAT usage this isn't a big deal since the only backend being used is GCC, so they just leave out this functionality. Whee. But if you try to build JGNAT, whoa! you have another backend! The code for this other backend isn't included with the JGNAT sources, though, it's included only with the GNAT sources released from AdaCore! So, I go get the GNAT sources (just the gcc/ada directory, not the entire GCC suite they post, too) and try to simply add in the files "missing" from my source tree. Of course, this doesn't work. So, I go whole-hog, replacing the ada components in my GCC-4.5.2 source tree with those from AdaCore, and apply the gcc-45.dif patch as instructed (which doesn't patch cleanly, so hand-tweaking is required). BAM! An obstacle course of errors arise, mostly syntax errors for the first dozen or so. I fix these with little problem, but once the syntax errors are out of the way, more onerous problems arise. After half a day of banging my head against this, I throw in the towel, and go download the entire GNAT sources from AdaCore. I compile all of the prereqs: gmp, mpc, binutils, etc. Then I patch the GCC provided with the GNAT sources provided. Okay, at least that works. Start to compile... BAM! Fail! I forgot, you can't compile an old version of GNAT with a more recent version. So back I go to get the GNAT binary. So, now with AdaCore's binary as my working compiler, I try again... BAM! Fail? Yeah, turns out that the --disable-libada option must be passed in AdaCore's gcc sources; gnattools and gnatlib must be compiled separately. Wasn't this fixed in the GCC trunk with GCC 4.1? So, again, this time with separate compilation for the GNAT stuff.... success! It compiled! w00t! So, because I'm careful, I run `make -k check`, just to be sure... and lo! there are many errors. Now, C and C ++ errors I'm used to, but this is pretty major. And I've never before built GNAT with any errors in ACATS or the gnat tests themselves. ACATS passes, but with a bunch of warnings, but the gnat tests themselves have an almost 20% failure rate. WTF!?! Running tests of my 4.5.2 build showed GNAT working perfectly... So this is about three days attempting to build JGNAT on GNU/Linux with no success. Supposedly I have a working compiler to build against, but not one that I actually trust. (BTW, why would I believe that the binary compiler is any better than the one I built if I compiled it from what I assume are the same sources?) I've been through the process of fitting AdaCore's tools with GCC-GNAT (I've successfully built both AUnit and ASIS against GCC-4.5.2 GNAT, but these took no small amount of tinkering), but I'm definitely hitting a wall here and I'm growing increasingly frustrated. Does anybody have any insight as to why AdaCore seems to keep so segregated from the rest of the free software world? I'm talking about more than just JGNAT here: GNAT for Mindstorms and their AVR compilers are both projects that I have a lot of use for, but they only release binaries for windows users, and I have serious doubts about being able to build them from source anyway if my experiences here are any indication. They maintain no public code repositories for any of these projects as far as I've seen, so there's no way to contribute in a meaningful way, either. Sometimes I think it would be easier if I didn't enjoy Ada so much... --deadlyhead