Re: [gentoo-dev] Changes in toolchain.eclass to enable Ada

2016-12-22 Thread Anthony G. Basile
On 12/22/16 3:11 PM, Michał Górny wrote:
> On Thu, 22 Dec 2016 14:55:05 +0100
> Alfredo Tupone  wrote:
> 
 I would like to start including, in the gentoo tree, GNAT-GPL
 built in the same way as sys-devel-gcc and selectable with gcc-config  
>>>
>>> 1. Does this mean that GNAT-GPL build will include building a C
>>> compiler? If yes, will the C compiler be installed?  
>> Yes, a C and a C++ compiler, and they will be installed
>>>
>>> 2. Will it be possible to combine GNAT-GPL with a different version of
>>> regular gcc C/C++ compilers?  
>> No, not easily
> 
> To be honest, I don't like this at all. This sounds like doubling
> the effort on maintaining gcc, and it sounds like people using GNAT-GPL
> would end up being forced to use old versions of GCC (also possibly
> missing patches).
> 
> If the Ada compiler requires Ada to boostrap anyway, can't you just
> make it build the Ada compiler alone?
> 

Yeah, I agree.

-- 
Anthony G. Basile, Ph.D.
Gentoo Linux Developer [Hardened]
E-Mail: bluen...@gentoo.org
GnuPG FP  : 1FED FAD9 D82C 52A5 3BAB  DC79 9384 FA6E F52D 4BBA
GnuPG ID  : F52D4BBA



Re: [gentoo-dev] Changes in toolchain.eclass to enable Ada

2016-12-22 Thread Alfredo Tupone
Il giorno Thu, 22 Dec 2016 21:11:45 +0100
Michał Górny  ha scritto:

> On Thu, 22 Dec 2016 14:55:05 +0100
> Alfredo Tupone  wrote:
> 
> > > > I would like to start including, in the gentoo tree, GNAT-GPL
> > > > built in the same way as sys-devel-gcc and selectable with
> > > > gcc-config
> > > 
> > > 1. Does this mean that GNAT-GPL build will include building a C
> > > compiler? If yes, will the C compiler be installed?
> > Yes, a C and a C++ compiler, and they will be installed  
> > > 
> > > 2. Will it be possible to combine GNAT-GPL with a different
> > > version of regular gcc C/C++ compilers?
> > No, not easily  
> 
> To be honest, I don't like this at all. This sounds like doubling
> the effort on maintaining gcc, and it sounds like people using
> GNAT-GPL would end up being forced to use old versions of GCC (also
> possibly missing patches).
All the patch that we (gentoo) apply to sys-devel/gcc-4.7.4 are applied
to gnat-gpl without any changes. Well I actually did two small patches
to the piepatches that apply to gcc, but the rest goes well.
It seems that gcc-4.7.4 and gcc included in gnat-gpl-2014 are very near.

I have still to check the newest 2015 (4.9.3) and 2016 (4.9.4) version.

The other path to provide gnat compiler to gentoo is using the one in
the FSF gcc. 
The advantage are 
a) that you don't have two gcc to align,
b) you can compile closed source.
but 
a) when you provide a new version of gcc you also need to check the
ada compiler
b) the ada compiler is an older version even if it is running on a new
gcc
> 
> If the Ada compiler requires Ada to boostrap anyway, can't you just
> make it build the Ada compiler alone?
> 
To bootstrap it needs a C, C++, and an Ada Compiler. and they should be
provided by using the gcc driver. (At least without changing a lot the
compilation scripts). So a standalone ada compiler cannot be used to
boostrap.

More over, as the gnat provide interfaces between languages, the layer
of interface between Ada and C++ depends on the version.
Sometimes happened that Ada and C++ had problems for differences in
the vtable layout (if I remember well, when going from gcc-3 to
gcc-4), or in mangling (gcc-2.8.1 to gcc-3, yes long time ago)
that caused problems when passing objects between languages. It
is better that the version of C++ and Ada used in a program are aligned.

If both are provided by the same gcc, that is automatic.



Re: [gentoo-dev] Changes in toolchain.eclass to enable Ada

2016-12-22 Thread Michał Górny
On Thu, 22 Dec 2016 14:55:05 +0100
Alfredo Tupone  wrote:

> > > I would like to start including, in the gentoo tree, GNAT-GPL
> > > built in the same way as sys-devel-gcc and selectable with gcc-config  
> > 
> > 1. Does this mean that GNAT-GPL build will include building a C
> > compiler? If yes, will the C compiler be installed?  
> Yes, a C and a C++ compiler, and they will be installed
> > 
> > 2. Will it be possible to combine GNAT-GPL with a different version of
> > regular gcc C/C++ compilers?  
> No, not easily

To be honest, I don't like this at all. This sounds like doubling
the effort on maintaining gcc, and it sounds like people using GNAT-GPL
would end up being forced to use old versions of GCC (also possibly
missing patches).

If the Ada compiler requires Ada to boostrap anyway, can't you just
make it build the Ada compiler alone?

-- 
Best regards,
Michał Górny



pgpdxqgV6FNDp.pgp
Description: OpenPGP digital signature


Re: [gentoo-dev] Changes in toolchain.eclass to enable Ada

2016-12-22 Thread Alfredo Tupone
On 13:49 Thu 22 Dec , Michał Górny wrote:
> On Wed, 21 Dec 2016 23:00:47 +0100
> Alfredo Tupone  wrote:
> 
> > I would like to revive the Ada support in gentoo.
> > 
> > One ada compiler is produced by AdaCore and is provided in three
> > versions, in the order starting from the best supported :
> > 
> > 1) GnatPro, available with a contract support.
> > 
> > 2) Gnat-GPL that can only build GPL-3 product
> > 
> > 3) The gnat included in the gcc tree that is GPL-3 with exception.
> > 
> > Gnat-GPL is very like the gnat in the gcc-tree so it can be built in
> > the same way of sys-devel/gcc
> > 
> > To be compiled from source the gcc compiler needs a C, C++, and Ada
> > Compiler. I will provide one with the gnat-gpl-bin tar that could be
> > installed under /opt . When the gcc is properly compiled we don't need
> > it any more.
> 
> Do I correctly understand that this is also true for gnat-gpl? Is there
> any Ada compiler that could be used to bootstrap Ada on platforms that
> lack prebuilt binaries?
There is no difference between gcc and gnat-gpl.
>From what I see adacore take a snapshot of gcc and make its own changes to
add ada supports.
So gnat-gpl needs a gnat compiler to be built, like vanilla gcc does.

>From my research on internet adacore "guarantees" that the compiler can be
built with itself or a version "-1" of it. Normally any version of a gnat
compiler that is enough near can build it, but, without any big work, I don't 
expect that either gcc or gnat-gpl can be built with other non gcc/gnat Ada 
compilers.
I have read of gcc ada compilers built on several platforms using cross
compilation. Maybe those could be used, like suggested in
https://bugs.gentoo.org/show_bug.cgi?id=592060
However I am for adding the boostrap via the binary provided by adacore
only, via gnat-gpl-bin packages. At least for the beginning.

> 
> > I would like to start including, in the gentoo tree, GNAT-GPL
> > built in the same way as sys-devel-gcc and selectable with gcc-config
> 
> 1. Does this mean that GNAT-GPL build will include building a C
> compiler? If yes, will the C compiler be installed?
Yes, a C and a C++ compiler, and they will be installed
> 
> 2. Will it be possible to combine GNAT-GPL with a different version of
> regular gcc C/C++ compilers?
No, not easily
> 
> > As for instance gnat-gpl-2014 is based on gcc-4.7.4 they cannot coexist
> > and gnat-gpl-2014 will block sys-devel/gcc-4.7.4
> 
> Block the whole sys-devel/ or just sys-devel/gcc[ada]?
Block the whole sys-devel/gcc-4.7.4
> 
> > As a reference I have my overlay on https://github.com/atupone/overlay
> > and a pull request at https://github.com/gentoo/gentoo/pull/3186
> > 
> > To start I need to change the toolchain.eclass 
> > 
> > -   tc_version_is_at_least 4.7 && IUSE+=" go"
> > +   tc_version_is_at_least 4.7 && IUSE+=" go ada"
> > 
> > -   # We do NOT want 'ADA support' in here!
> > -   # is_ada && GCC_LANG+=",ada"
> > +   # We do want 'ADA support' here!
> > +   is_ada && GCC_LANG+=",ada" 
> > 
> > -   for x in cpp gcc g++ c++ gcov g77 gcj gcjh gfortran gccgo ; do
> > +   for x in cpp gcc g++ c++ gcov g77 gcj gcjh gfortran gccgo gnatbind; do 
> > 
> > Thats all for that.
> > 
> > Then, to not change the behaviour of the gcc-compiler, we could mask the
> > ada use flag for sys-devel/gcc, at least temporarily
> > 
> > -
> > 
> > I would like to have comments on that, particularly because:
> > a) it is going to add a use flag to sys-devel/gcc that will bring gcc
> > to be rebuilt on most system, 
> 
> That's a minor problem. Toolchain people do this on us all the time,
> so...
> 
> > b) the gnat-gpl, if selected with gcc-config, can be used to recompile
> > all the system, and maybe is not so good ?
> 
> I don't really understand what you mean here. But it's probably related
> to the questions I asked above.
> 
> -- 
> Best regards,
> Michał Górny
> 





Re: [gentoo-dev] Changes in toolchain.eclass to enable Ada

2016-12-22 Thread Michał Górny
On Wed, 21 Dec 2016 23:00:47 +0100
Alfredo Tupone  wrote:

> I would like to revive the Ada support in gentoo.
> 
> One ada compiler is produced by AdaCore and is provided in three
> versions, in the order starting from the best supported :
> 
> 1) GnatPro, available with a contract support.
> 
> 2) Gnat-GPL that can only build GPL-3 product
> 
> 3) The gnat included in the gcc tree that is GPL-3 with exception.
> 
> Gnat-GPL is very like the gnat in the gcc-tree so it can be built in
> the same way of sys-devel/gcc
> 
> To be compiled from source the gcc compiler needs a C, C++, and Ada
> Compiler. I will provide one with the gnat-gpl-bin tar that could be
> installed under /opt . When the gcc is properly compiled we don't need
> it any more.

Do I correctly understand that this is also true for gnat-gpl? Is there
any Ada compiler that could be used to bootstrap Ada on platforms that
lack prebuilt binaries?

> I would like to start including, in the gentoo tree, GNAT-GPL
> built in the same way as sys-devel-gcc and selectable with gcc-config

1. Does this mean that GNAT-GPL build will include building a C
compiler? If yes, will the C compiler be installed?

2. Will it be possible to combine GNAT-GPL with a different version of
regular gcc C/C++ compilers?

> As for instance gnat-gpl-2014 is based on gcc-4.7.4 they cannot coexist
> and gnat-gpl-2014 will block sys-devel/gcc-4.7.4

Block the whole sys-devel/ or just sys-devel/gcc[ada]?

> As a reference I have my overlay on https://github.com/atupone/overlay
> and a pull request at https://github.com/gentoo/gentoo/pull/3186
> 
> To start I need to change the toolchain.eclass 
> 
> - tc_version_is_at_least 4.7 && IUSE+=" go"
> + tc_version_is_at_least 4.7 && IUSE+=" go ada"
> 
> - # We do NOT want 'ADA support' in here!
> - # is_ada && GCC_LANG+=",ada"
> + # We do want 'ADA support' here!
> + is_ada && GCC_LANG+=",ada" 
> 
> - for x in cpp gcc g++ c++ gcov g77 gcj gcjh gfortran gccgo ; do
> + for x in cpp gcc g++ c++ gcov g77 gcj gcjh gfortran gccgo gnatbind; do 
> 
> Thats all for that.
> 
> Then, to not change the behaviour of the gcc-compiler, we could mask the
> ada use flag for sys-devel/gcc, at least temporarily
> 
> -
> 
> I would like to have comments on that, particularly because:
> a) it is going to add a use flag to sys-devel/gcc that will bring gcc
> to be rebuilt on most system, 

That's a minor problem. Toolchain people do this on us all the time,
so...

> b) the gnat-gpl, if selected with gcc-config, can be used to recompile
> all the system, and maybe is not so good ?

I don't really understand what you mean here. But it's probably related
to the questions I asked above.

-- 
Best regards,
Michał Górny



pgp9CB2oTWDBu.pgp
Description: OpenPGP digital signature


[gentoo-dev] Changes in toolchain.eclass to enable Ada

2016-12-21 Thread Alfredo Tupone
I would like to revive the Ada support in gentoo.

One ada compiler is produced by AdaCore and is provided in three
versions, in the order starting from the best supported :

1) GnatPro, available with a contract support.

2) Gnat-GPL that can only build GPL-3 product

3) The gnat included in the gcc tree that is GPL-3 with exception.

Gnat-GPL is very like the gnat in the gcc-tree so it can be built in
the same way of sys-devel/gcc

To be compiled from source the gcc compiler needs a C, C++, and Ada
Compiler. I will provide one with the gnat-gpl-bin tar that could be
installed under /opt . When the gcc is properly compiled we don't need
it any more.

I would like to start including, in the gentoo tree, GNAT-GPL
built in the same way as sys-devel-gcc and selectable with gcc-config

As for instance gnat-gpl-2014 is based on gcc-4.7.4 they cannot coexist
and gnat-gpl-2014 will block sys-devel/gcc-4.7.4

As a reference I have my overlay on https://github.com/atupone/overlay
and a pull request at https://github.com/gentoo/gentoo/pull/3186

To start I need to change the toolchain.eclass 

-   tc_version_is_at_least 4.7 && IUSE+=" go"
+   tc_version_is_at_least 4.7 && IUSE+=" go ada"

-   # We do NOT want 'ADA support' in here!
-   # is_ada && GCC_LANG+=",ada"
+   # We do want 'ADA support' here!
+   is_ada && GCC_LANG+=",ada" 

-   for x in cpp gcc g++ c++ gcov g77 gcj gcjh gfortran gccgo ; do
+   for x in cpp gcc g++ c++ gcov g77 gcj gcjh gfortran gccgo gnatbind; do 

Thats all for that.

Then, to not change the behaviour of the gcc-compiler, we could mask the
ada use flag for sys-devel/gcc, at least temporarily

-

I would like to have comments on that, particularly because:
a) it is going to add a use flag to sys-devel/gcc that will bring gcc
to be rebuilt on most system, 
b) the gnat-gpl, if selected with gcc-config, can be used to recompile
all the system, and maybe is not so good ?

Alfredo