configure, Darwin: Require explicit selection of COBOL.

Message ID 20250311100455.74871-1-iain@sandoe.co.uk
State New
Headers
Series configure, Darwin: Require explicit selection of COBOL. |

Commit Message

Iain Sandoe March 11, 2025, 10:04 a.m. UTC
  Tested on x86_64-darwin21 for
  --enable-languages=all
    => configure: WARNING: cobol not supported for this target
  --enable-languages=all,cobol
    => cobol is added to the languages to build.

OK for trunk?
thanks, Iain

--- 8< ---

By defult, Darwin does not have sufficient tools to build COBOL
so we do not want to include it in --enable-languages=all since
this will break regular testing of all supported languages.

However, we do want to be able to build it on demand (where the
build system has sufficiently new tools) and so do not want to
disable it permanently.

ChangeLog:

	* configure: Regenerate.
	* configure.ac: Do not build COBOL on Darwin by default,
	even for --enable-languages=all.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
---
 configure    | 7 +++++--
 configure.ac | 3 +++
 2 files changed, 8 insertions(+), 2 deletions(-)
  

Comments

Richard Biener March 11, 2025, 10:09 a.m. UTC | #1
On Tue, 11 Mar 2025, Iain Sandoe wrote:

> Tested on x86_64-darwin21 for
>   --enable-languages=all
>     => configure: WARNING: cobol not supported for this target
>   --enable-languages=all,cobol
>     => cobol is added to the languages to build.
> 
> OK for trunk?

OK.

Thanks,
Richard.

> thanks, Iain
> 
> --- 8< ---
> 
> By defult, Darwin does not have sufficient tools to build COBOL
> so we do not want to include it in --enable-languages=all since
> this will break regular testing of all supported languages.
> 
> However, we do want to be able to build it on demand (where the
> build system has sufficiently new tools) and so do not want to
> disable it permanently.
> 
> ChangeLog:
> 
> 	* configure: Regenerate.
> 	* configure.ac: Do not build COBOL on Darwin by default,
> 	even for --enable-languages=all.
> 
> Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
> ---
>  configure    | 7 +++++--
>  configure.ac | 3 +++
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/configure b/configure
> index 2a91458effc..4666c86c5f0 100755
> --- a/configure
> +++ b/configure
> @@ -3585,11 +3585,14 @@ case ,${enable_languages}, in
>      ;;
>    *)
>      case "${target}" in
> +      *-*-darwin*)
> +        unsupported_languages="$unsupported_languages cobol"
> +        ;;
>        x86_64-*-*|aarch64-*-*)
>          ;;
>        *-*-*)
> -	unsupported_languages="$unsupported_languages cobol"
> -	;;
> +    unsupported_languages="$unsupported_languages cobol"
> +    ;;
>      esac
>      case "${host}" in
>        x86_64-*-*|aarch64-*-*)
> diff --git a/configure.ac b/configure.ac
> index 414578566fa..a1b3604dd81 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -805,6 +805,9 @@ case ,${enable_languages}, in
>      ;;
>    *)
>      case "${target}" in
> +      *-*-darwin*)
> +        unsupported_languages="$unsupported_languages cobol"
> +        ;;
>        x86_64-*-*|aarch64-*-*)
>          ;;
>        *-*-*)
>
  
Rainer Orth March 11, 2025, 10:52 a.m. UTC | #2
Hi Iain,

> Tested on x86_64-darwin21 for
>   --enable-languages=all
>     => configure: WARNING: cobol not supported for this target
>   --enable-languages=all,cobol
>     => cobol is added to the languages to build.
>
> OK for trunk?

for the time being, I think it would be better to do this the other way
round: the COBOL code is so full of Linuxisms that it's likely to break
any non-Linux target at the moment.  When trying Solaris/amd64 and
Solaris/sparcv9 bootstraps, I came across

* symbols.h:

  __GLIBC_USE			Linux-only

  strtof128			dto.

  NAME_MAX			undef on Solaris, variable

* cdf-copy.cc:

  basename			clashes with <libgen.h>

  GLOB_BRACE, GLOB_TILDE	Linux extension?

	Rainer
  
Richard Biener March 11, 2025, 11:07 a.m. UTC | #3
On Tue, 11 Mar 2025, Rainer Orth wrote:

> Hi Iain,
> 
> > Tested on x86_64-darwin21 for
> >   --enable-languages=all
> >     => configure: WARNING: cobol not supported for this target
> >   --enable-languages=all,cobol
> >     => cobol is added to the languages to build.
> >
> > OK for trunk?
> 
> for the time being, I think it would be better to do this the other way
> round: the COBOL code is so full of Linuxisms that it's likely to break
> any non-Linux target at the moment.  When trying Solaris/amd64 and
> Solaris/sparcv9 bootstraps, I came across

It is a whitelist already - but OS agnostic.  Feel free to provide
a patch restricting it to -linux hosts for the time being.

There's now a cobol component in bugzilla, so can you open bugreports,
separately for each host (gcc/cobol) and each target (libgcobol)
build issues?

Thanks,
Richard.

> * symbols.h:
> 
>   __GLIBC_USE			Linux-only
> 
>   strtof128			dto.
> 
>   NAME_MAX			undef on Solaris, variable
> 
> * cdf-copy.cc:
> 
>   basename			clashes with <libgen.h>
> 
>   GLOB_BRACE, GLOB_TILDE	Linux extension?
> 
> 	Rainer
> 
>
  

Patch

diff --git a/configure b/configure
index 2a91458effc..4666c86c5f0 100755
--- a/configure
+++ b/configure
@@ -3585,11 +3585,14 @@  case ,${enable_languages}, in
     ;;
   *)
     case "${target}" in
+      *-*-darwin*)
+        unsupported_languages="$unsupported_languages cobol"
+        ;;
       x86_64-*-*|aarch64-*-*)
         ;;
       *-*-*)
-	unsupported_languages="$unsupported_languages cobol"
-	;;
+    unsupported_languages="$unsupported_languages cobol"
+    ;;
     esac
     case "${host}" in
       x86_64-*-*|aarch64-*-*)
diff --git a/configure.ac b/configure.ac
index 414578566fa..a1b3604dd81 100644
--- a/configure.ac
+++ b/configure.ac
@@ -805,6 +805,9 @@  case ,${enable_languages}, in
     ;;
   *)
     case "${target}" in
+      *-*-darwin*)
+        unsupported_languages="$unsupported_languages cobol"
+        ;;
       x86_64-*-*|aarch64-*-*)
         ;;
       *-*-*)