comp.lang.ada
 help / color / mirror / Atom feed
From: deadlyhead <deadlyhead@gmail.com>
Subject: Thoughts on AdaCore maintaining GCC-incompatible GNAT sources
Date: Thu, 20 Jan 2011 02:58:17 -0800 (PST)
Date: 2011-01-20T02:58:17-08:00	[thread overview]
Message-ID: <62c8c6c1-6578-4e61-b68a-2c192f34aa94@f20g2000prn.googlegroups.com> (raw)

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 à 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



             reply	other threads:[~2011-01-20 10:58 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-20 10:58 deadlyhead [this message]
2011-01-20 13:37 ` Thoughts on AdaCore maintaining GCC-incompatible GNAT sources Ludovic Brenta
2011-01-20 14:50   ` Yannick Duchêne (Hibou57)
2011-01-20 17:47     ` J-P. Rosen
2011-01-20 18:46       ` Yannick Duchêne (Hibou57)
2011-01-20 21:03         ` Simon Wright
2011-01-20 21:56           ` deadlyhead
2011-01-21  0:08             ` qunying
2011-01-21  4:43             ` Stephen Leake
2011-01-22  5:09               ` Randy Brukardt
2011-01-22  6:15                 ` Yannick Duchêne (Hibou57)
2011-01-25  1:29                   ` Randy Brukardt
2011-02-06 19:58                     ` Yannick Duchêne (Hibou57)
2011-01-21  7:19             ` J-P. Rosen
2011-01-21  9:29               ` Dmitry A. Kazakov
2011-01-21  9:57                 ` Yannick Duchêne (Hibou57)
2011-01-21 13:51                 ` J-P. Rosen
2011-01-21 15:26                 ` Fritz Wuehler
2011-01-21 19:50                   ` Yannick Duchêne (Hibou57)
2011-02-05 12:40                 ` Marco
2011-01-22 15:29             ` Lucretia
2011-01-21  7:11         ` J-P. Rosen
2011-01-21  4:33     ` Stephen Leake
2011-01-21  5:00       ` Shark8
2011-01-21  6:26         ` Thomas Løcke
2011-01-21 10:05           ` Yannick Duchêne (Hibou57)
2011-01-21 19:11           ` Oliver Kellogg
2011-01-21 19:42             ` Yannick Duchêne (Hibou57)
2011-01-21 20:41               ` Simon Wright
2011-01-21 22:14                 ` Yannick Duchêne (Hibou57)
2011-01-22 15:28 ` Lucretia
2011-02-03  9:40   ` deadlyhead
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox