public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada PATCH] Update configure to check for a recent gnat Ada compiler.
@ 2022-07-30 22:06 Roger Sayle
  2022-08-01  7:25 ` Arnaud Charlet
  0 siblings, 1 reply; 2+ messages in thread
From: Roger Sayle @ 2022-07-30 22:06 UTC (permalink / raw)
  To: 'GCC Patches'; +Cc: 'Eric Botcazou'

[-- Attachment #1: Type: text/plain, Size: 901 bytes --]


GCC fails to bootstrap when configured with --enable-languages=all on
machines that have older versions of GNAT installed as the system Ada
compiler.  In configure, it's not sufficient to check whether gnat is
available, but whether a sufficiently recent version of GNAT is
installed.  This patch tweaks config/acx.m4 so that conftest.adb also
contains a reference to System.CRTL.int64 as required by the current
version of gcc/ada/osint.adb.  This fixes the build when the system
Ada is GNAT v4.8.5 (on Redhat 7) by disabling ada, but continues to
work fine when the system Ada is GNAT v11.3.1.

Tested in x86_64-pc-linux-gnu.  Ok for mainline?


2022-07-30  Roger Sayle  <roger@nextmovesoftware.com>

ChangeLog
        * config/acx.me (AC_PROG_GNAT): Update conftest.adb to include
        features required of the host gnat compiler.
        * configure: Regenerate.

Thanks in advance,
Roger
--


[-- Attachment #2: patchgn.txt --]
[-- Type: text/plain, Size: 911 bytes --]

diff --git a/config/acx.m4 b/config/acx.m4
index b86c4f9..bd3e7f8 100644
--- a/config/acx.m4
+++ b/config/acx.m4
@@ -396,6 +396,10 @@ AC_CHECK_TOOL(GNATMAKE, gnatmake, no)
 AC_CACHE_CHECK([whether compiler driver understands Ada],
 		 acx_cv_cc_gcc_supports_ada,
 [cat >conftest.adb <<EOF
+pragma Warnings (Off);
+with System.CRTL;
+pragma Warnings (On);
+use type System.CRTL.int64;
 procedure conftest is begin null; end conftest;
 EOF
 acx_cv_cc_gcc_supports_ada=no
diff --git a/configure b/configure
index 65d7078..3ddcc9f 100755
--- a/configure
+++ b/configure
@@ -5608,6 +5608,10 @@ if ${acx_cv_cc_gcc_supports_ada+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.adb <<EOF
+pragma Warnings (Off);
+with System.CRTL;
+pragma Warnings (On);
+use type System.CRTL.int64;
 procedure conftest is begin null; end conftest;
 EOF
 acx_cv_cc_gcc_supports_ada=no

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Ada PATCH] Update configure to check for a recent gnat Ada compiler.
  2022-07-30 22:06 [Ada PATCH] Update configure to check for a recent gnat Ada compiler Roger Sayle
@ 2022-08-01  7:25 ` Arnaud Charlet
  0 siblings, 0 replies; 2+ messages in thread
From: Arnaud Charlet @ 2022-08-01  7:25 UTC (permalink / raw)
  To: Roger Sayle; +Cc: 'GCC Patches', 'Eric Botcazou'

> GCC fails to bootstrap when configured with --enable-languages=all on
> machines that have older versions of GNAT installed as the system Ada
> compiler.  In configure, it's not sufficient to check whether gnat is
> available, but whether a sufficiently recent version of GNAT is
> installed.  This patch tweaks config/acx.m4 so that conftest.adb also
> contains a reference to System.CRTL.int64 as required by the current
> version of gcc/ada/osint.adb.  This fixes the build when the system
> Ada is GNAT v4.8.5 (on Redhat 7) by disabling ada, but continues to
> work fine when the system Ada is GNAT v11.3.1.
> 
> Tested in x86_64-pc-linux-gnu.  Ok for mainline?
> 
> 
> 2022-07-30  Roger Sayle  <roger@nextmovesoftware.com>
> 
> ChangeLog
>         * config/acx.me (AC_PROG_GNAT): Update conftest.adb to include
>         features required of the host gnat compiler.
>         * configure: Regenerate.
> 
> Thanks in advance,
> Roger
> --
> 

> diff --git a/config/acx.m4 b/config/acx.m4
> index b86c4f9..bd3e7f8 100644
> --- a/config/acx.m4
> +++ b/config/acx.m4
> @@ -396,6 +396,10 @@ AC_CHECK_TOOL(GNATMAKE, gnatmake, no)
>  AC_CACHE_CHECK([whether compiler driver understands Ada],

I'd suggest changing the text above to e.g. "whether compiler driver understands Ada and is recent enough"

OK with this change, thanks!

>  		 acx_cv_cc_gcc_supports_ada,
>  [cat >conftest.adb <<EOF
> +pragma Warnings (Off);
> +with System.CRTL;
> +pragma Warnings (On);
> +use type System.CRTL.int64;
>  procedure conftest is begin null; end conftest;
>  EOF
>  acx_cv_cc_gcc_supports_ada=no
> diff --git a/configure b/configure
> index 65d7078..3ddcc9f 100755
> --- a/configure
> +++ b/configure
> @@ -5608,6 +5608,10 @@ if ${acx_cv_cc_gcc_supports_ada+:} false; then :
>    $as_echo_n "(cached) " >&6
>  else
>    cat >conftest.adb <<EOF
> +pragma Warnings (Off);
> +with System.CRTL;
> +pragma Warnings (On);
> +use type System.CRTL.int64;
>  procedure conftest is begin null; end conftest;
>  EOF
>  acx_cv_cc_gcc_supports_ada=no


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-01  7:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-30 22:06 [Ada PATCH] Update configure to check for a recent gnat Ada compiler Roger Sayle
2022-08-01  7:25 ` Arnaud Charlet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).