On Thu, Jan 15, 2026 at 4:58 PM Stefan Schulze Frielinghaus
<[email protected]> wrote:
>
> From: Stefan Schulze Frielinghaus <[email protected]>
>
> Instead of emitting a warning for each invocation of gcc as done by v1,
> emit an error/warning during configure.  I'm utilizing --enable-obsolete
> in order to make sure that users are notified, in case they previously
> were building with multilib enabled (implicitly or explicitly) or even
> for target s390.
>
> If there are no further comments I will commit this the coming days
> (incl. wwwdocs update).

Thanks, that looks most reasonable now.

Richard.

> -- >8 --
>
> Support for -m31 is deprecated and will be removed in a future release.
>
> In order to let users know, emit an error/warning during configure.  An
> error is thrown if --enable-multilib is given implicitly, or if
> explicitly but not --enable-obsolete.
> ---
>  configure           | 16 ++++++++++++++++
>  configure.ac        | 15 +++++++++++++++
>  gcc/config.gcc      |  9 +++++++++
>  gcc/doc/invoke.texi |  3 ++-
>  4 files changed, 42 insertions(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index bb0905df77f..576e2534831 100755
> --- a/configure
> +++ b/configure
> @@ -11755,6 +11755,22 @@ case 
> "$target:$have_compiler:$host:$target:$enable_multilib" in
>      ;;
>  esac
>
> +# For s390, -m31 is deprecated.  Emit a warning if --enable-multilib and
> +# --enable-obsolete are explicitly specified.  If --enable-multilib is
> +# specified implicitly or --enable-obsolete is missing, error out.
> +case "$target:$enable_multilib:$enable_obsolete" in
> +  s390*:yes:yes)
> +    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Support for -m31 is 
> deprecated and will be removed." >&5
> +$as_echo "$as_me: WARNING: Support for -m31 is deprecated and will be 
> removed." >&2;}
> +    ;;
> +  s390*::*)
> +    as_fn_error $? "Support for -m31 is deprecated and will be removed. 
> Explicitly specify --disable-multilib or --enable-multilib --enable-obsolete 
> to build it anyway." "$LINENO" 5
> +    ;;
> +  s390*:yes:*)
> +    as_fn_error $? "Support for -m31 is deprecated and will be removed. 
> Specify --enable-obsolete to build it anyway." "$LINENO" 5
> +    ;;
> +esac
> +
>  # Default to --enable-multilib.
>  if test x${enable_multilib} = x ; then
>    target_configargs="--enable-multilib ${target_configargs}"
> diff --git a/configure.ac b/configure.ac
> index 5b870256771..31ad7cd04e1 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -3825,6 +3825,21 @@ case 
> "$target:$have_compiler:$host:$target:$enable_multilib" in
>      ;;
>  esac
>
> +# For s390, -m31 is deprecated.  Emit a warning if --enable-multilib and
> +# --enable-obsolete are explicitly specified.  If --enable-multilib is
> +# specified implicitly or --enable-obsolete is missing, error out.
> +case "$target:$enable_multilib:$enable_obsolete" in
> +  s390*:yes:yes)
> +    AC_MSG_WARN([Support for -m31 is deprecated and will be removed.])
> +    ;;
> +  s390*::*)
> +    AC_MSG_ERROR([Support for -m31 is deprecated and will be removed. 
> Explicitly specify --disable-multilib or --enable-multilib --enable-obsolete 
> to build it anyway.])
> +    ;;
> +  s390*:yes:*)
> +    AC_MSG_ERROR([Support for -m31 is deprecated and will be removed. 
> Specify --enable-obsolete to build it anyway.])
> +    ;;
> +esac
> +
>  # Default to --enable-multilib.
>  if test x${enable_multilib} = x ; then
>    target_configargs="--enable-multilib ${target_configargs}"
> diff --git a/gcc/config.gcc b/gcc/config.gcc
> index 30fcacba392..159beb549c8 100644
> --- a/gcc/config.gcc
> +++ b/gcc/config.gcc
> @@ -292,6 +292,15 @@ case ${target} in
>      fi;;
>  esac
>
> +case ${target} in
> +  s390-*)
> +    if test "x$enable_obsolete" != xyes; then
> +      echo "*** Configuration ${target} is deprecated and will be removed." 
> >&2
> +      echo "*** Specify --enable-obsolete to build it anyway." >&2
> +      exit 1
> +    fi;;
> +esac
> +
>  # Unsupported targets list.  Do not put an entry in this list unless
>  # it would otherwise be caught by a more permissive pattern.  The list
>  # should be in alphabetical order.
> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
> index 6e6969f96b6..4b2dfd620d9 100644
> --- a/gcc/doc/invoke.texi
> +++ b/gcc/doc/invoke.texi
> @@ -33988,7 +33988,8 @@ GNU/Linux for S/390 ABI@.  When @option{-m64} is 
> specified, generate
>  code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
>  particular to generate 64-bit instructions.  For the @samp{s390}
>  targets, the default is @option{-m31}, while the @samp{s390x}
> -targets default to @option{-m64}.
> +targets default to @option{-m64}.  Note, @option{-m31} is deprecated and
> +support will be removed.
>
>  @opindex mzarch
>  @opindex mesa
> --
> 2.49.0
>

Reply via email to