Skip to contentSkip to conversation

Adding support to conditionally build the GNAT Ada compiler in the toolchain.

PATCH New Thomas Petazzoni 1 participant 3 messages May 21, 2018 – Jul 24, 2018 3 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 Adding support to conditionally build the GNAT Ada compiler in the toolchain.

Hello Glen,

Thanks for this contribution! First of all, your patch didn't make it to the Buildroot mailing list. Perhaps you forgot to subscribe to the mailing list ? If you don't want to receive all the mailing list traffic, you can subscribe and then disable mail delivery.

See below for some comments about your submission.

First of all, the commit title should be something like:

gcc: add support for building the Ada compiler

Quoted 11 lines · Glen Cornell
---
 package/gcc/Config.in.host         | 12 ++++++++++++
 package/gcc/gcc-final/gcc-final.mk |  1 +
 2 files changed, 13 insertions(+)
package/gcc/Config.in.host +0 -0
index 7c08fb3596..06ffe586af 100644

package/gcc/Config.in.host config BR2_TOOLCHAIN_BUILDROOT_CXX · line 98

Quoted 7 lines
package/gcc/Config.in.host +4 -0
@@ -92,6 +92,18 @@ config BR2_TOOLCHAIN_BUILDROOT_CXX
 	  C++ language and you want C++ libraries to be installed on
 	  your target system.
 
+config BR2_TOOLCHAIN_BUILDROOT_ADA
+	bool "Enable Ada support"
+	select BR2_INSTALL_LIBSTDCPP
+	select BR2_SHARED_STATIC_LIBS

You can't select BR2_SHARED_STATIC_LIBS, because this option is part of a choice. You can only "depends on BR2_SHARED_STATIC_LIBS".

But first and foremost, why do you need BR2_SHARED_STATIC_LIBS ?

package/gcc/Config.in.host config BR2_TOOLCHAIN_BUILDROOT_CXX · line 102

Quoted 4 lines
package/gcc/Config.in.host +4 -0
+	help
+	  Enable this option if you want your toolchain to support the
+	  Ada language.  Note: Not only must your native host compiler
+	  support Ada

For this one, we need to add something like BR2_NEEDS_HOST_GNAT in the main Config.in option (like BR2_NEEDS_HOST_JAVAC). This option will be selected by BR2_TOOLCHAIN_BUILDROOT_ADA, and support/dependencies/dependencies.sh should check that a host Ada compiler is available.

package/gcc/Config.in.host

Quoted 2 lines

, but also the libstdc++.a static library must be

package/gcc/Config.in.host +1 -0
+	  installed on your build host.

This looks weird. Why ?

package/gcc/Config.in.host

Quoted 3 lines

Selecting this option will

package/gcc/Config.in.host +2 -0
+	  also build the C++ compiler and static libraries, which are
+	  required to build support for Ada in gcc.

We don't really need this paragraph I believe.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

PATCH 1/1 Adding support to conditionally build the GNAT Ada compiler in the toolchain.

Hello,

Quoted 2 lines · Glen Cornell

Thanks for the comments. I?ll update my patch in accordance with your comments and resubmit.

Great, thanks!

Quoted 3 lines

FYI - the libstdc++.a dependency I found strange as well. Although I didn?t investigate the nature of the dependency, without it, the build fails

Then we'll have to do some research on this, because if libstdc++.a is really needed on the host machine, we'll have to add a check in support/dependencies/dependencies.sh for this.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

PATCH 1/1 Adding support to conditionally build the GNAT Ada compiler in the toolchain.

Hello,

Quoted 5 lines · Glen Cornell

Hi Thomas. I didn?t want to leave you hanging on this. I did some research on this. It appears that the version of the gnat cross compiler is dependent upon the version of the host gnat compiler. It?s something that would break most build environments where the two versions differ.

OK. This could be resolved by building our own gcc/gnat native compiler. It's a bit of effort obviously, but it could be done.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com