Re: [gentoo-dev] Adding Ada support

2023-12-09 Thread Eli Schwartz
On 12/9/23 10:51 AM, Luke A. Guest wrote:
>>> Can we add the following patch to the toolchain.eclass? I want to stop
>>> having to mess with this overlay. The diff can be generated by
>>> grabbing the repo https://github.com/Lucretia/ada-overlay and running
>>> ./scripts/diff_eclass.sh.
>>
>> It'd be useful to send the whole lot with `git send-email` as proper
>> patches which could be `git am`'d.
>>
> 
> Ok, just looked at this. I don't have sendmail installed here. Due to
> the way I've worked on this, the only way I know how to btw and which
> was pointed to initially on the #gentoo-* channels. Which is to have a
> remote (covered in the README from today) in which I can diff the eclass
> with my version to make sure I only ever have ada changes and cherry
> pick what I need into my eclass.
> 
> If there is a way, I'll send it, but you'll need to guide me on what I
> need to do to do it.


The git send-email tools don't require mail-mta/sendmail installed, but
they do need git to be built with USE=perl. That being said, not
everyone is familiar with how to actually use `git send-email`, it can
be a bit tricky to set it up to connect with your email account via
SMTP. In particular, if your provider doesn't like you to authenticate
without OAuth.

If you like, there's a way to prepare your patches via a guided web UI
workflow: https://man.sr.ht/git.sr.ht/#sending-patches-upstream

tl;dr push your repository to https://git.sr.ht and have it send out the
commits you select to the email address you select.

Hope that helps,

-- 
Eli Schwartz




[gentoo-dev] [PATCH] python-utils-r1.eclass: Disable pytest-salt-factories by default

2023-12-09 Thread Michał Górny
Signed-off-by: Michał Górny 
---
 eclass/python-utils-r1.eclass | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index da9cb820840f..188278f09212 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1382,6 +1382,8 @@ epytest() {
-p no:pytest-describe
-p no:plus
-p no:tavern
+   # does something to logging
+   -p no:salt-factories
)
fi
 
-- 
2.43.0




Re: [gentoo-dev] Adding Ada support

2023-12-09 Thread Luke A. Guest

Sorry about the spam, I just squashed the two commits together.From 471dbc22de2c31e4ca4191d70cc8bcbe452f3b97 Mon Sep 17 00:00:00 2001
From: "Luke A. Guest" 
Date: Sat, 9 Dec 2023 18:05:31 +
Subject: [PATCH] Add building Ada support into the base toolchain (GCC)
 mechanics. Add Ada bootstrap ebuilds for all versions of GCC supported.

---
 dev-lang/ada-bootstrap/Manifest   | 13 +
 .../ada-bootstrap/ada-bootstrap-10.ebuild | 25 +
 .../ada-bootstrap/ada-bootstrap-11.ebuild | 25 +
 .../ada-bootstrap/ada-bootstrap-12.ebuild | 25 +
 .../ada-bootstrap/ada-bootstrap-13.ebuild | 25 +
 .../ada-bootstrap/ada-bootstrap-14.ebuild | 25 +
 dev-lang/ada-bootstrap/ada-bootstrap-9.ebuild | 25 +
 dev-lang/ada-bootstrap/metadata.xml   | 12 +
 eclass/toolchain.eclass   | 53 +++
 9 files changed, 219 insertions(+), 9 deletions(-)
 create mode 100644 dev-lang/ada-bootstrap/Manifest
 create mode 100644 dev-lang/ada-bootstrap/ada-bootstrap-10.ebuild
 create mode 100644 dev-lang/ada-bootstrap/ada-bootstrap-11.ebuild
 create mode 100644 dev-lang/ada-bootstrap/ada-bootstrap-12.ebuild
 create mode 100644 dev-lang/ada-bootstrap/ada-bootstrap-13.ebuild
 create mode 100644 dev-lang/ada-bootstrap/ada-bootstrap-14.ebuild
 create mode 100644 dev-lang/ada-bootstrap/ada-bootstrap-9.ebuild
 create mode 100644 dev-lang/ada-bootstrap/metadata.xml

diff --git a/dev-lang/ada-bootstrap/Manifest b/dev-lang/ada-bootstrap/Manifest
new file mode 100644
index 0..07af81d3f
--- /dev/null
+++ b/dev-lang/ada-bootstrap/Manifest
@@ -0,0 +1,13 @@
+DIST ada-bootstrap-10-x86_64.tar.xz 81374924 BLAKE2B 73f831502c1c358a724092e2eae17b13c2905c8c2afe90a24c61d152755cf0c33549eca65f23ed5d2ce893799b7bac9a48c0e2e513b53076e424d1fb5c92c84b SHA512 eb0b89f5912e217ecdabd4867ab68909aca73ea46c300e1ee75fbdfa308d296570af7dde49d56278a1662ac1734619afd105232df680a24d301b81c8bffe927b
+DIST ada-bootstrap-11-x86_64.tar.xz 86529888 BLAKE2B b42d2ca86d721371bd0c363549b3a562e7d92583ba773544b0a14e105980643626abbd0bc1b125836be76842dcca8222606266f9795e678094b80afabb4090b1 SHA512 ef2ccbf9f65aaa2a5b64d696d65319c539f9e28b419d01b619bf66867db924037760374a2dc2c341c154b9c2aa653426ae29ece24d2bf5d91ef1f23d4a1b7e87
+DIST ada-bootstrap-12-x86_64.tar.xz 92699120 BLAKE2B b1f0c2d9ba4711f0f066a640c5a5ae53177826a160a25f31d89f4b402a21bc6a4e432c5cb9bfff10d6a73097c22cec9dfd097649ea6438a41eb4f1226b7478af SHA512 7f257c1e0c7adb6aa92a68e2f8b4bf7191467aafdb592fbc163529390c4de1c661ded3b231b56fe65fa810c190a34b0c17cd2225345dc82a6867dc6f479cec2b
+DIST ada-bootstrap-13-x86_64.tar.xz 94802444 BLAKE2B c0e170b56212897fe15a093e5e8d629a9e3e4aa51ec163d42cdbbe65dd54c30651023d440c0a41dc49d86e6406ac80adbf3761a0c174aeb75e774f4d905b SHA512 8c995f7ad4cf45cddbd98e811807eb5f9908ca35e1b552e0c6e307bfd47b8bdc8b3bc4406637deb7762c3c450da55116a50a3af0fb8ca3877ff6b030ba1b50c2
+DIST ada-bootstrap-14-x86_64.tar.xz 95049476 BLAKE2B 373376f2847bb07f441cc83d73db388722e1b9f6c631aa62fb0e8a9b1f90725b1a7e4e0d38970b8c59a53b76e7b019ddaf505ab52f76698c3db357dfe3382e6f SHA512 a6fc012058aef52bc784c1dc254f0aa31f8e034b517b49d4faef7058fe84c02e9bac564029bd7b05cb97a2ce0a40b875b0378236bd055522012e13069c4affcb
+DIST ada-bootstrap-9-x86_64.tar.xz 70563044 BLAKE2B 4de949ddbc6feb589be93737b794e4bea93bf7e8291f5b1fe31aa5a2c2027594eb4eb1aac46cc42cc2872224e4b6ce556e9126635046e080adee70e48b217934 SHA512 b90f61ef18c6b6203d76698d2dba633e2187d1a623bb0b5ef1c735599b2db2a76765569460ff3d3817f845c575299cf35bb9896998b941cb4a92dab95462e255
+EBUILD ada-bootstrap-10.ebuild 769 BLAKE2B df6d0d857a25d109ed0aef3f06442eee8577c5fb37cc496eb935347a8b5991fbbf800bdfd3d17dcaa2d883fbb5b55be0c46304d863b330ee86f5e578f13b2382 SHA512 bbe1f380b7ab6dcdb43ff7328f3c20ae53b6ace9694bc89c219996a9d46223d9bb662749c658c7120073ffaab5bcb6c7e91370ac13a13e8754235a62870d0454
+EBUILD ada-bootstrap-11.ebuild 769 BLAKE2B a3d123cc8d0f99c47ac9c488261bb706e8ef288345c5ec524ef32f2835b2b5681f15df0932565cc0629970c72cbe6a77b46036851498e8164cbefff43b104e4a SHA512 cda446533f3ef6cc6ffa1380450e0d1c2fa3b8480dbd1f3d84185f9eff7fe7f591ac1827d475542ddb15c8b8477a2791d37e5f59e381c279b296f757c6c40a24
+EBUILD ada-bootstrap-12.ebuild 769 BLAKE2B 928050dca7f68fded8b17a0f22c72b3796e3e63b2f7d390a92a0d6f9ffbafa8b7d0e9f09036b4ea9f3c78075037508e28bbc0caabed21725bf7d5f0f95b82d53 SHA512 8382219d72936882cee12962e3b9f64b9dde8deabc7c9024c09e082f73d048366f920c13777e09b73376fd8f2d446d391eb59bd5453d1cbca151a5052fd1c169
+EBUILD ada-bootstrap-13.ebuild 769 BLAKE2B 417c3711fb149ee44aad787025eff7a48a21fd9a7ceb001cc833d650f6ccb34e91233cf6809053bdb868c216e496732efd22f10828c8f1db7c229d8acc6c6e61 SHA512 fc96ddcc4b5bf18208409e25de933d07a4f895ffc94eb99427c79f92a9565eec8df5b4b5574bcc6c90e654359a5c9e56b7b67b60fc99b72e2bb1667dd01e2834
+EBUILD ada-bootstrap-14.ebuild 769 BLAKE2B a83e0fd49a48c9c9e564f8ea41f46ef8b50e00d215d97b56f54badfb8e4be8c83c5049a4eee99efefbb55bc5550bea2386bf5bf67aa9f42c3525e05ea10d1a94 SHA512 b0a24fe

Re: [gentoo-dev] Adding Ada support

2023-12-09 Thread Luke A. Guest



On 09/12/2023 15:12, Sam James wrote:


"Luke A. Guest"  writes:


Hi,

Can we add the following patch to the toolchain.eclass? I want to stop
having to mess with this overlay. The diff can be generated by
grabbing the repo https://github.com/Lucretia/ada-overlay and running
./scripts/diff_eclass.sh.


It'd be useful to send the whole lot with `git send-email` as proper
patches which could be `git am`'d.


This is the best I can do rn.
From ba248f432b46473734c506fdc8cadd1bea24b656 Mon Sep 17 00:00:00 2001
From: "Luke A. Guest" 
Date: Sat, 9 Dec 2023 17:32:31 +
Subject: [PATCH 1/2] Add building Ada support into the base toolchain (GCC)
 mechanics.
To: gentoo-dev@lists.gentoo.org

---
 eclass/toolchain.eclass | 53 ++---
 1 file changed, 44 insertions(+), 9 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 60769c938..7368894ab 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -250,7 +250,6 @@ if [[ ${PN} != kgcc64 && ${PN} != gcc-* ]] ; then
 	IUSE+=" go"
 	IUSE+=" +sanitize"  TC_FEATURES+=( sanitize )
 	IUSE+=" graphite" TC_FEATURES+=( graphite )
-	IUSE+=" ada"
 	IUSE+=" vtv"
 	IUSE+=" jit"
 	tc_version_is_between 5.0 9 && IUSE+=" mpx"
@@ -259,6 +258,7 @@ if [[ ${PN} != kgcc64 && ${PN} != gcc-* ]] ; then
 	IUSE+=" systemtap" TC_FEATURES+=( systemtap )
 
 	tc_version_is_at_least 9.0 && IUSE+=" d" TC_FEATURES+=( d )
+	tc_version_is_at_least 9.0 && IUSE+=" ada" TC_FEATURES+=( ada )
 	tc_version_is_at_least 9.1 && IUSE+=" lto"
 	tc_version_is_at_least 10 && IUSE+=" cet"
 	tc_version_is_at_least 10 && IUSE+=" zstd" TC_FEATURES+=( zstd )
@@ -284,8 +284,7 @@ fi
 
 #>> DEPEND <<
 
-RDEPEND="
-	sys-libs/zlib
+RDEPEND="sys-libs/zlib
 	virtual/libiconv
 	nls? ( virtual/libintl )
 "
@@ -311,6 +310,20 @@ BDEPEND="
 		>=sys-devel/autogen-5.5.4
 	)
 "
+
+# Ada in 9.0+ is self-hosting and needs Ada to bootstrap.
+# Taken from the D version below. I'm fairly sure if this is now correct,
+# We should build using either ada-bootstrap: if the installed gcc has
+# Ada disabled or the installed slot which matches the slot being built.
+if tc_has_feature ada ; then
+	if tc_version_is_at_least 9.0 ; then
+		BDEPEND+=" ada? ( || (
+			> Ada Bootstrap slot is ${GCCMAJOR}/${PREVSLOT}"
+
+		# Make sure we set a path to the Ada bootstrap if gcc[ada] is not already
+		# installed. GNAT can usually be built using the last major version and
+		# the current version, at least.
+		if has_version -b "sys-devel/gcc:${SLOT}[ada]" ; then
+			einfo "Using GNAT compiler installed in slot ${SLOT}..."
+
+			PATH="${BINPATH}:${PATH}"
+		elif has_version -b "sys-devel/gcc:${PREVSLOT}[ada]" ; then
+			einfo "Using GNAT compiler installed in previous slot ${PREVSLOT}..."
+
+			PATH="${PREFIX}/${CTARGET}/gcc-bin/${PREVSLOT}:${PATH}"
+		else
+			einfo "Using bootstrap GNAT compiler..."
+
+			PATH="/opt/ada-bootstrap-${GCCMAJOR}/bin:${PATH}"
+
+			export PATH
+		fi
+	fi
+
 	confgcc+=(
 		--prefix="${PREFIX}"
 		--bindir="${BINPATH}"
@@ -1335,6 +1368,8 @@ toolchain_src_configure() {
 	einfo "DATAPATH:${DATAPATH}"
 	einfo "STDCXX_INCDIR:   ${STDCXX_INCDIR}"
 	einfo "Languages:   ${GCC_LANG}"
+	einfo "GCC version: $(gcc -v 2>&1|grep " version " | awk '{ print $3 }')"
+	is_ada && einfo "GNAT version:$(gnat 2>&1|grep GNAT | awk '{ print $2 }')"
 	echo
 
 	# Build in a separate build tree
-- 
2.43.0

From 000a1670e2fb89b51ac24ff8e207e77550468df8 Mon Sep 17 00:00:00 2001
From: "Luke A. Guest" 
Date: Sat, 9 Dec 2023 17:48:02 +
Subject: [PATCH 2/2] Add Ada bootstrap ebuilds for all versions of GCC
 supported.
To: gentoo-dev@lists.gentoo.org

---
 dev-lang/ada-bootstrap/Manifest   | 13 ++
 .../ada-bootstrap/ada-bootstrap-10.ebuild | 25 +++
 .../ada-bootstrap/ada-bootstrap-11.ebuild | 25 +++
 .../ada-bootstrap/ada-bootstrap-12.ebuild | 25 +++
 .../ada-bootstrap/ada-bootstrap-13.ebuild | 25 +++
 .../ada-bootstrap/ada-bootstrap-14.ebuild | 25 +++
 dev-lang/ada-bootstrap/ada-bootstrap-9.ebuild | 25 +++
 dev-lang/ada-bootstrap/metadata.xml   | 12 +
 8 files changed, 175 insertions(+)
 create mode 100644 dev-lang/ada-bootstrap/Manifest
 create mode 100644 dev-lang/ada-bootstrap/ada-bootstrap-10.ebuild
 create mode 100644 dev-lang/ada-bootstrap/ada-bootstrap-11.ebuild
 create mode 100644 dev-lang/ada-bootstrap/ada-bootstrap-12.ebuild
 create mode 100644 dev-lang/ada-bootstrap/ada-bootstrap-13.ebuild
 create mode 100644 dev-lang/ada-bootstrap/ada-bootstrap-14.ebuild
 create mode 100644 dev-lang/ada-bootstrap/ada-bootstrap-9.ebuild
 create mode 100644 dev-lang/ada-bootstrap/metadata.xml

diff --git a/dev-lang/ada-bootstrap/Manifest b/dev-lang/ada-bootstrap/Manifest
new file mode 100644
index 0..07af81d3f
--- /dev/null
+++ b/dev-lang/ada-bootstrap/Manifest
@@ -0,0 +1,13 @@
+DIST ada-bootstrap-

Re: [gentoo-dev] Adding Ada support

2023-12-09 Thread Luke A. Guest

Can we add the following patch to the toolchain.eclass? I want to stop
having to mess with this overlay. The diff can be generated by
grabbing the repo https://github.com/Lucretia/ada-overlay and running
./scripts/diff_eclass.sh.


It'd be useful to send the whole lot with `git send-email` as proper
patches which could be `git am`'d.



Ok, just looked at this. I don't have sendmail installed here. Due to 
the way I've worked on this, the only way I know how to btw and which 
was pointed to initially on the #gentoo-* channels. Which is to have a 
remote (covered in the README from today) in which I can diff the eclass 
with my version to make sure I only ever have ada changes and cherry 
pick what I need into my eclass.


If there is a way, I'll send it, but you'll need to guide me on what I 
need to do to do it.


Thanks,
Luke.




Re: [gentoo-dev] Adding Ada support

2023-12-09 Thread Luke A. Guest
And this is what gcc:13 +ada would install: 
https://gist.github.com/Lucretia/4837322a4d4ea331246600513ed40aaf



On 09/12/2023 15:30, Luke A. Guest wrote:

and FYI, I've been utilising this overlay for Ada for over a year.





Re: [gentoo-dev] Adding Ada support

2023-12-09 Thread Luke A. Guest

and FYI, I've been utilising this overlay for Ada for over a year.



Re: [gentoo-dev] Adding Ada support

2023-12-09 Thread Luke A. Guest




On 09/12/2023 15:12, Sam James wrote:


"Luke A. Guest"  writes:


Hi,

Can we add the following patch to the toolchain.eclass? I want to stop
having to mess with this overlay. The diff can be generated by
grabbing the repo https://github.com/Lucretia/ada-overlay and running
./scripts/diff_eclass.sh.


It'd be useful to send the whole lot with `git send-email` as proper
patches which could be `git am`'d.


Can't really do that as you'd get a lot of stuff that's not required for 
portage.




The only thing I'm not sure about is the BDEPEND stuff.


It looks OK from a glance.



The reason for doing this is because gnat-gpl is dead, more info can
be found here https://www.adacore.com/community.

The
https://github.com/Lucretia/ada-overlay/tree/master/dev-lang/ada-bootstrap
ebuilds provide bootstrap compilers, the archives are hosted on
dropbox, from 9.5.0 -> 14.



What is going to be a problem is using these. We'll need to build our
own.


You can use those to build your own then as you need a bootstrap to 
start with.



The scripts/build-bootstrap.sh script will build a bootstrap for a
particular version based on an env var.



But if this works, I guess that's fine. It would be nice if there were
some we could use from elsewhere somewhat-official that other distros
are using, but if they don't exist, I guess we have to live with it.

We need to do the same for D.


As I said, these are built and packaged as tars, you could change the 
script to add in d as well if you wanted. It's not a complex script, it 
builds what is needed and dumps it to /tmp/opt/ and then installs it to 
/opt with the ebuild.



As for anything in dev-ada/* well, the ada guy would need to work on
that really, I'm not really experienced enough to handle it properly.



Kind of curious as to your interest in Ada if you're not experienced
enough - not intended derogatorily, just know you've been interested
in Ada for a while so I wonder if dev-ada/* is somehow that different
or what..


I'm not experienced enough with ebuilds.



I also wouldn't want to merge something if it's then going to conflict
with anything in dev-ada/*, so at least some coordination is required.

(To that end, cc'd toolchain@ and ada@.)


Yes, as I state in the README, I disable all the ::gentoo ada stuff with 
another script.



Given GCC is masked up to :10 now, the gnat gpr tools / libs might be
easier to get going with single versions covering numerous toolchain
versions.

Alire would need to be added at some point, http://alire.ada.dev/ to
provide an easier way to get packages going.

I originally envisioned gnatmake, gprbuild eclasses to cover building
simple projects with one entry point (gnatmake) and projects
(gprbuild). I think an alire based eclass would need to be added as
well.

Thanks,
Luke.

[2. text/x-patch; gentoo-diff.patch]...







Re: [gentoo-dev] Adding Ada support

2023-12-09 Thread Sam James


"Luke A. Guest"  writes:

> Hi,
>
> Can we add the following patch to the toolchain.eclass? I want to stop
> having to mess with this overlay. The diff can be generated by
> grabbing the repo https://github.com/Lucretia/ada-overlay and running
> ./scripts/diff_eclass.sh.

It'd be useful to send the whole lot with `git send-email` as proper
patches which could be `git am`'d.

>
> The only thing I'm not sure about is the BDEPEND stuff.

It looks OK from a glance.

>
> The reason for doing this is because gnat-gpl is dead, more info can
> be found here https://www.adacore.com/community.
>
> The
> https://github.com/Lucretia/ada-overlay/tree/master/dev-lang/ada-bootstrap
> ebuilds provide bootstrap compilers, the archives are hosted on
> dropbox, from 9.5.0 -> 14.
>

What is going to be a problem is using these. We'll need to build our
own.

> The scripts/build-bootstrap.sh script will build a bootstrap for a
> particular version based on an env var.
>

But if this works, I guess that's fine. It would be nice if there were
some we could use from elsewhere somewhat-official that other distros
are using, but if they don't exist, I guess we have to live with it.

We need to do the same for D.

> As for anything in dev-ada/* well, the ada guy would need to work on
> that really, I'm not really experienced enough to handle it properly.
>

Kind of curious as to your interest in Ada if you're not experienced
enough - not intended derogatorily, just know you've been interested
in Ada for a while so I wonder if dev-ada/* is somehow that different
or what..

I also wouldn't want to merge something if it's then going to conflict
with anything in dev-ada/*, so at least some coordination is required.

(To that end, cc'd toolchain@ and ada@.)

> Given GCC is masked up to :10 now, the gnat gpr tools / libs might be
> easier to get going with single versions covering numerous toolchain
> versions.
>
> Alire would need to be added at some point, http://alire.ada.dev/ to
> provide an easier way to get packages going.
>
> I originally envisioned gnatmake, gprbuild eclasses to cover building
> simple projects with one entry point (gnatmake) and projects
> (gprbuild). I think an alire based eclass would need to be added as
> well.
>
> Thanks,
> Luke.
>
> [2. text/x-patch; gentoo-diff.patch]...




[gentoo-dev] Adding Ada support

2023-12-09 Thread Luke A. Guest

Hi,

Can we add the following patch to the toolchain.eclass? I want to stop 
having to mess with this overlay. The diff can be generated by grabbing 
the repo https://github.com/Lucretia/ada-overlay and running 
./scripts/diff_eclass.sh.


The only thing I'm not sure about is the BDEPEND stuff.

The reason for doing this is because gnat-gpl is dead, more info can be 
found here https://www.adacore.com/community.


The 
https://github.com/Lucretia/ada-overlay/tree/master/dev-lang/ada-bootstrap 
ebuilds provide bootstrap compilers, the archives are hosted on dropbox, 
from 9.5.0 -> 14.


The scripts/build-bootstrap.sh script will build a bootstrap for a 
particular version based on an env var.


As for anything in dev-ada/* well, the ada guy would need to work on 
that really, I'm not really experienced enough to handle it properly.


Given GCC is masked up to :10 now, the gnat gpr tools / libs might be 
easier to get going with single versions covering numerous toolchain 
versions.


Alire would need to be added at some point, http://alire.ada.dev/ to 
provide an easier way to get packages going.


I originally envisioned gnatmake, gprbuild eclasses to cover building 
simple projects with one entry point (gnatmake) and projects (gprbuild). 
I think an alire based eclass would need to be added as well.


Thanks,
Luke.diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 60769c93877f..7368894abd2f 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -250,7 +250,6 @@ if [[ ${PN} != kgcc64 && ${PN} != gcc-* ]] ; then
 	IUSE+=" go"
 	IUSE+=" +sanitize"  TC_FEATURES+=( sanitize )
 	IUSE+=" graphite" TC_FEATURES+=( graphite )
-	IUSE+=" ada"
 	IUSE+=" vtv"
 	IUSE+=" jit"
 	tc_version_is_between 5.0 9 && IUSE+=" mpx"
@@ -259,6 +258,7 @@ if [[ ${PN} != kgcc64 && ${PN} != gcc-* ]] ; then
 	IUSE+=" systemtap" TC_FEATURES+=( systemtap )
 
 	tc_version_is_at_least 9.0 && IUSE+=" d" TC_FEATURES+=( d )
+	tc_version_is_at_least 9.0 && IUSE+=" ada" TC_FEATURES+=( ada )
 	tc_version_is_at_least 9.1 && IUSE+=" lto"
 	tc_version_is_at_least 10 && IUSE+=" cet"
 	tc_version_is_at_least 10 && IUSE+=" zstd" TC_FEATURES+=( zstd )
@@ -284,8 +284,7 @@ fi
 
 #>> DEPEND <<
 
-RDEPEND="
-	sys-libs/zlib
+RDEPEND="sys-libs/zlib
 	virtual/libiconv
 	nls? ( virtual/libintl )
 "
@@ -311,6 +310,20 @@ BDEPEND="
 		>=sys-devel/autogen-5.5.4
 	)
 "
+
+# Ada in 9.0+ is self-hosting and needs Ada to bootstrap.
+# Taken from the D version below. I'm fairly sure if this is now correct,
+# We should build using either ada-bootstrap: if the installed gcc has
+# Ada disabled or the installed slot which matches the slot being built.
+if tc_has_feature ada ; then
+	if tc_version_is_at_least 9.0 ; then
+		BDEPEND+=" ada? ( || (
+			> Ada Bootstrap slot is ${GCCMAJOR}/${PREVSLOT}"
+
+		# Make sure we set a path to the Ada bootstrap if gcc[ada] is not already
+		# installed. GNAT can usually be built using the last major version and
+		# the current version, at least.
+		if has_version -b "sys-devel/gcc:${SLOT}[ada]" ; then
+			einfo "Using GNAT compiler installed in slot ${SLOT}..."
+
+			PATH="${BINPATH}:${PATH}"
+		elif has_version -b "sys-devel/gcc:${PREVSLOT}[ada]" ; then
+			einfo "Using GNAT compiler installed in previous slot ${PREVSLOT}..."
+
+			PATH="${PREFIX}/${CTARGET}/gcc-bin/${PREVSLOT}:${PATH}"
+		else
+			einfo "Using bootstrap GNAT compiler..."
+
+			PATH="/opt/ada-bootstrap-${GCCMAJOR}/bin:${PATH}"
+
+			export PATH
+		fi
+	fi
+
 	confgcc+=(
 		--prefix="${PREFIX}"
 		--bindir="${BINPATH}"
@@ -1335,6 +1368,8 @@ toolchain_src_configure() {
 	einfo "DATAPATH:${DATAPATH}"
 	einfo "STDCXX_INCDIR:   ${STDCXX_INCDIR}"
 	einfo "Languages:   ${GCC_LANG}"
+	einfo "GCC version: $(gcc -v 2>&1|grep " version " | awk '{ print $3 }')"
+	is_ada && einfo "GNAT version:$(gnat 2>&1|grep GNAT | awk '{ print $2 }')"
 	echo
 
 	# Build in a separate build tree