This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libada configure contains wrong code and GNAT as a cross compiler in general

On Wed, Jan 09, 2013 at 08:43:11AM +0000, Luke A. Guest wrote:
> Hi,
> I'm trying to add GNAT to Yocto and still coming across problems. I have
> a number of questions about GNAT as a cross compiler, I know it wasn't
> designed as one within the GCC tree, but I think it needs to be capable
> of building as one to match the other compilers.
> 1) The latest problem I'm having is that it fails to build
>, I've managed to track it down to the following code
> inside libada/configure:
>     # Determine what to build for 'gnatlib'
>     if test $build = $target \
>        && test ${enable_shared} = yes ; then
>       # Note that build=target is almost certainly the wrong test; FIXME
>       default_gnatlib_target="gnatlib-shared"
>     else
>       default_gnatlib_target="gnatlib-plain"
>     fi
> Surely, it shouldn't matter whether the $build = $target is true or not,
> it should be whether the target supports shared libs or not. So, am I ok
> to remove this test (keeping the enable_shared test)? Is there anything
> else that could break because of this change?
> In fact, should the code in libada/configure script actually do platform
> tests, just as they are done in the gnattools/configure script?

I can't speak for libada/*, I'm not familiar enough with these, but they may
well contain errors indeed.

> 2) I also want to point out that inside
> gcc/ada/gcc-interface/ there are lines such as:
>     GNATLIB_SHARED = gnatlib-shared-dual
> Is these relics?

No, these are correct settings. If there's a mistake, it might be in libada.

> If so, shouldn't the above configure script also use
> the "-dual" and the other options available to it?
> 3) Coming back to gnattools, there are tests in there to set the
> TOOLS_TARGET_PAIRS variable, which are also set in
> gcc/ada/gcc-interface/, are the ones set in the
> also relics? Can they be removed from there?

No, these are not relics, these are actually the reference settings,
and used e.g. when using --disable-libada

> 4) What is the point of the --disable-libada flag exactly? I've seen a

To disable automatic build of gnatlib and gnattools. This is used e.g. at
AdaCore to configure in a more fine grained manner how gnatlib and gnattools
are built. Ideally we'd like to use the libada/gnatools mechanism, but
this mechanism isn't quite working as we'd need it, so this hasn't happened

gnattools will either use the run-time just built in case of a native compiler,
and will use the base compiler's run-time in case of a cross (hence the
requirement that you first need to build a native GNAT before building a cross,
using matching sources).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]