public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: [PATCH][4.9] PR 64569 - Backport support for MIPS binutils 2.25
@ 2015-01-26 18:04 Matthew Fortune
  2015-02-07  8:21 ` Matthew Fortune
  2015-02-17 20:10 ` Matthew Fortune
  0 siblings, 2 replies; 6+ messages in thread
From: Matthew Fortune @ 2015-01-26 18:04 UTC (permalink / raw)
  To: 'gcc-patches@gcc.gnu.org' (gcc-patches@gcc.gnu.org)
  Cc: Moore, Catherine (Catherine_Moore@mentor.com)

> This is a minimal backport of features added to GCC 5 to enable use
> of binutils 2.25 with GCC 4.9 for MIPS soft-float builds. Further
> details in the PR:
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64569
> 
> The commits which are being backported are listed below (the last
> one is posted but not committed yet).
> 
> r213870: Fix mips16.S for soft-float
> r213872: Pass -m(soft|hard|single|double)-float via ASM_SPEC
> r217446: Implement o32 FPXX (very minimal backport)
> r217939: Update configure check for HAVE_MIPS_DOT_MODULE
> r??????: Make ASM_SPEC changes conditional on HAVE_MIPS_DOT_MODULE

Updated - The last one in the list is committed as:
r219867: MIPS: Only pass floating-point options to the assembler when necessary

I'm not sure who to CC as RM for GCC 4.9.

Thanks,
Matthew

> 
> gcc/
> 	* config.in [!USED_FOR_TARGET] (HAVE_AS_DOT_MODULE): Undefine.
> 	* config/mips/mips.h (FP_ASM_SPEC): New macro.
> 	(ASM_SPEC): Use FP_ASM_SPEC.
> 	* configure.ac (HAVE_AS_DOT_MODULE): Detect support for .module
> 	and FPXX extensions.
> 
> libgcc/
> 	* config/mips/mips16.S: Do not build for soft-float.
> 
> Once this is done I will do the same backport for GCC 4.8.
> 
> Tested to check that soft-float builds work with binutils 2.25 and
> the floating-point options are not passed for binutils 2.24.
> 
> Thanks,
> Matthew
> 
> ---
>  gcc/config.in               |  6 ++++++
>  gcc/config/mips/mips.h      | 19 ++++++++++++++++++-
>  gcc/configure               | 32 ++++++++++++++++++++++++++++++++
>  gcc/configure.ac            |  7 +++++++
>  libgcc/config/mips/mips16.S | 10 +++++++---
>  5 files changed, 70 insertions(+), 4 deletions(-)
> 
> diff --git a/gcc/config.in b/gcc/config.in
> index 1e85325..013a606 100644
> --- a/gcc/config.in
> +++ b/gcc/config.in
> @@ -447,6 +447,12 @@
>  #endif
> 
> 
> +/* Define if the assembler understands .module. */
> +#ifndef USED_FOR_TARGET
> +#undef HAVE_AS_DOT_MODULE
> +#endif
> +
> +
>  /* Define if your assembler supports the -no-mul-bug-abort option. */
>  #ifndef USED_FOR_TARGET
>  #undef HAVE_AS_NO_MUL_BUG_ABORT_OPTION
> diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
> index a786d4c..ff88d98 100644
> --- a/gcc/config/mips/mips.h
> +++ b/gcc/config/mips/mips.h
> @@ -1163,6 +1163,22 @@ struct mips_cpu_info {
>  #define SUBTARGET_ASM_SPEC ""
>  #endif
> 
> +/* FP_ASM_SPEC represents the floating-point options that must be passed
> +   to the assembler when FPXX support exists.  Prior to that point the
> +   assembler could accept the options but were not required for
> +   correctness.  We only add the options when absolutely necessary
> +   because passing -msoft-float to the assembler will cause it to reject
> +   all hard-float instructions which may require some user code to be
> +   updated.  */
> +
> +#ifdef HAVE_AS_DOT_MODULE
> +#define FP_ASM_SPEC "\
> +%{mhard-float} %{msoft-float} \
> +%{msingle-float} %{mdouble-float}"
> +#else
> +#define FP_ASM_SPEC
> +#endif
> +
>  #undef ASM_SPEC
>  #define ASM_SPEC "\
>  %{G*} %(endian_spec) %{mips1} %{mips2} %{mips3} %{mips4} \
> @@ -1188,7 +1204,8 @@ struct mips_cpu_info {
>  %{mfp32} %{mfp64} %{mnan=*} \
>  %{mshared} %{mno-shared} \
>  %{msym32} %{mno-sym32} \
> -%{mtune=*} \
> +%{mtune=*}" \
> +FP_ASM_SPEC "\
>  %(subtarget_asm_spec)"
> 
>  /* Extra switches sometimes passed to the linker.  */
> diff --git a/gcc/configure b/gcc/configure
> index 291e463..d5b6879 100755
> --- a/gcc/configure
> +++ b/gcc/configure
> @@ -26140,6 +26140,38 @@ $as_echo "#define HAVE_AS_GNU_ATTRIBUTE 1"
> >>confdefs.h
> 
>  fi
> 
> +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for
> .module support" >&5
> +$as_echo_n "checking assembler for .module support... " >&6; }
> +if test "${gcc_cv_as_mips_dot_module+set}" = set; then :
> +  $as_echo_n "(cached) " >&6
> +else
> +  gcc_cv_as_mips_dot_module=no
> +  if test x$gcc_cv_as != x; then
> +    $as_echo '.module mips2
> +       .module fp=xx' > conftest.s
> +    if { ac_try='$gcc_cv_as $gcc_cv_as_flags -32 -o conftest.o conftest.s
> >&5'
> +  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
> +  (eval $ac_try) 2>&5
> +  ac_status=$?
> +  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> +  test $ac_status = 0; }; }
> +    then
> +	gcc_cv_as_mips_dot_module=yes
> +    else
> +      echo "configure: failed program was" >&5
> +      cat conftest.s >&5
> +    fi
> +    rm -f conftest.o conftest.s
> +  fi
> +fi
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result:
> $gcc_cv_as_mips_dot_module" >&5
> +$as_echo "$gcc_cv_as_mips_dot_module" >&6; }
> +if test $gcc_cv_as_mips_dot_module = yes; then
> +
> +$as_echo "#define HAVE_AS_DOT_MODULE 1" >>confdefs.h
> +
> +fi
> +
>      { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for
> .micromips support" >&5
>  $as_echo_n "checking assembler for .micromips support... " >&6; }
>  if test "${gcc_cv_as_micromips_support+set}" = set; then :
> diff --git a/gcc/configure.ac b/gcc/configure.ac
> index b9a3799..ded0c48 100644
> --- a/gcc/configure.ac
> +++ b/gcc/configure.ac
> @@ -4251,6 +4251,13 @@ LCF0:
>        [AC_DEFINE(HAVE_AS_GNU_ATTRIBUTE, 1,
>  	  [Define if your assembler supports .gnu_attribute.])])
> 
> +    gcc_GAS_CHECK_FEATURE([.module support],
> +      gcc_cv_as_mips_dot_module,,[-32],
> +      [.module mips2
> +       .module fp=xx],,
> +      [AC_DEFINE(HAVE_AS_DOT_MODULE, 1,
> +	  [Define if your assembler supports .module.])])
> +
>      gcc_GAS_CHECK_FEATURE([.micromips support],
>        gcc_cv_as_micromips_support,,[--fatal-warnings],
>        [.set micromips],,
> diff --git a/libgcc/config/mips/mips16.S b/libgcc/config/mips/mips16.S
> index 6a43a98..dde8939 100644
> --- a/libgcc/config/mips/mips16.S
> +++ b/libgcc/config/mips/mips16.S
> @@ -21,8 +21,12 @@ a copy of the GCC Runtime Library Exception along with
> this program;
>  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
>  <http://www.gnu.org/licenses/>.  */
> 
> -#ifdef __mips_micromips
> -  /* DO NOTHING */
> +#if defined(__mips_micromips) || defined(__mips_soft_float)
> +  /* Do nothing because this code is only needed when linking
> +     against mips16 hard-float objects.  Neither micromips code
> +     nor soft-float code can be linked against mips16 hard-float
> +     objects so we do not need these routines when building libgcc
> +     for those cases.  */
>  #else
> 
>  /* This file contains mips16 floating point support functions.  These
> @@ -749,4 +753,4 @@ CALL_STUB_RET (__mips16_call_stub_dc_10, 10, DC)
>  #endif /* !__mips_single_float */
> 
>  #endif
> -#endif /* __mips_micromips */
> +#endif /* defined(__mips_micromips) || defined(__mips_soft_float) */
> --
> 2.2.1

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

* RE: [PATCH][4.9] PR 64569 - Backport support for MIPS binutils 2.25
  2015-01-26 18:04 [PATCH][4.9] PR 64569 - Backport support for MIPS binutils 2.25 Matthew Fortune
@ 2015-02-07  8:21 ` Matthew Fortune
  2015-02-17 20:10 ` Matthew Fortune
  1 sibling, 0 replies; 6+ messages in thread
From: Matthew Fortune @ 2015-02-07  8:21 UTC (permalink / raw)
  To: jakub
  Cc: Moore, Catherine (Catherine_Moore@mentor.com),
	'gcc-patches@gcc.gnu.org' (gcc-patches@gcc.gnu.org),
	aaro.koskinen

Hi Jakub,

I haven't done a backport to a release branch before. Could you tell me
who needs to approve this change, it only affects MIPS?

Thanks,
Matthew

> -----Original Message-----
> From: Matthew Fortune
> Sent: 26 January 2015 16:30
> To: 'gcc-patches@gcc.gnu.org' (gcc-patches@gcc.gnu.org)
> Cc: Moore, Catherine (Catherine_Moore@mentor.com)
> Subject: RE: [PATCH][4.9] PR 64569 - Backport support for MIPS binutils
> 2.25
> 
> > This is a minimal backport of features added to GCC 5 to enable use of
> > binutils 2.25 with GCC 4.9 for MIPS soft-float builds. Further details
> > in the PR:
> >
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64569
> >
> > The commits which are being backported are listed below (the last one
> > is posted but not committed yet).
> >
> > r213870: Fix mips16.S for soft-float
> > r213872: Pass -m(soft|hard|single|double)-float via ASM_SPEC
> > r217446: Implement o32 FPXX (very minimal backport)
> > r217939: Update configure check for HAVE_MIPS_DOT_MODULE
> > r??????: Make ASM_SPEC changes conditional on HAVE_MIPS_DOT_MODULE
> 
> Updated - The last one in the list is committed as:
> r219867: MIPS: Only pass floating-point options to the assembler when
> necessary
> 
> I'm not sure who to CC as RM for GCC 4.9.
> 
> Thanks,
> Matthew
> 
> >
> > gcc/
> > 	* config.in [!USED_FOR_TARGET] (HAVE_AS_DOT_MODULE): Undefine.
> > 	* config/mips/mips.h (FP_ASM_SPEC): New macro.
> > 	(ASM_SPEC): Use FP_ASM_SPEC.
> > 	* configure.ac (HAVE_AS_DOT_MODULE): Detect support for .module
> > 	and FPXX extensions.
> >
> > libgcc/
> > 	* config/mips/mips16.S: Do not build for soft-float.
> >
> > Once this is done I will do the same backport for GCC 4.8.
> >
> > Tested to check that soft-float builds work with binutils 2.25 and the
> > floating-point options are not passed for binutils 2.24.
> >
> > Thanks,
> > Matthew
> >
> > ---
> >  gcc/config.in               |  6 ++++++
> >  gcc/config/mips/mips.h      | 19 ++++++++++++++++++-
> >  gcc/configure               | 32 ++++++++++++++++++++++++++++++++
> >  gcc/configure.ac            |  7 +++++++
> >  libgcc/config/mips/mips16.S | 10 +++++++---
> >  5 files changed, 70 insertions(+), 4 deletions(-)
> >
> > diff --git a/gcc/config.in b/gcc/config.in index 1e85325..013a606
> > 100644
> > --- a/gcc/config.in
> > +++ b/gcc/config.in
> > @@ -447,6 +447,12 @@
> >  #endif
> >
> >
> > +/* Define if the assembler understands .module. */ #ifndef
> > +USED_FOR_TARGET #undef HAVE_AS_DOT_MODULE #endif
> > +
> > +
> >  /* Define if your assembler supports the -no-mul-bug-abort option. */
> > #ifndef USED_FOR_TARGET  #undef HAVE_AS_NO_MUL_BUG_ABORT_OPTION diff
> > --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index
> > a786d4c..ff88d98 100644
> > --- a/gcc/config/mips/mips.h
> > +++ b/gcc/config/mips/mips.h
> > @@ -1163,6 +1163,22 @@ struct mips_cpu_info {  #define
> > SUBTARGET_ASM_SPEC ""
> >  #endif
> >
> > +/* FP_ASM_SPEC represents the floating-point options that must be
> passed
> > +   to the assembler when FPXX support exists.  Prior to that point
> the
> > +   assembler could accept the options but were not required for
> > +   correctness.  We only add the options when absolutely necessary
> > +   because passing -msoft-float to the assembler will cause it to
> reject
> > +   all hard-float instructions which may require some user code to be
> > +   updated.  */
> > +
> > +#ifdef HAVE_AS_DOT_MODULE
> > +#define FP_ASM_SPEC "\
> > +%{mhard-float} %{msoft-float} \
> > +%{msingle-float} %{mdouble-float}"
> > +#else
> > +#define FP_ASM_SPEC
> > +#endif
> > +
> >  #undef ASM_SPEC
> >  #define ASM_SPEC "\
> >  %{G*} %(endian_spec) %{mips1} %{mips2} %{mips3} %{mips4} \ @@ -1188,7
> > +1204,8 @@ struct mips_cpu_info {  %{mfp32} %{mfp64} %{mnan=*} \
> > %{mshared} %{mno-shared} \  %{msym32} %{mno-sym32} \ -%{mtune=*} \
> > +%{mtune=*}" \
> > +FP_ASM_SPEC "\
> >  %(subtarget_asm_spec)"
> >
> >  /* Extra switches sometimes passed to the linker.  */ diff --git
> > a/gcc/configure b/gcc/configure index 291e463..d5b6879 100755
> > --- a/gcc/configure
> > +++ b/gcc/configure
> > @@ -26140,6 +26140,38 @@ $as_echo "#define HAVE_AS_GNU_ATTRIBUTE 1"
> > >>confdefs.h
> >
> >  fi
> >
> > +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for
> > .module support" >&5
> > +$as_echo_n "checking assembler for .module support... " >&6; } if
> > +test "${gcc_cv_as_mips_dot_module+set}" = set; then :
> > +  $as_echo_n "(cached) " >&6
> > +else
> > +  gcc_cv_as_mips_dot_module=no
> > +  if test x$gcc_cv_as != x; then
> > +    $as_echo '.module mips2
> > +       .module fp=xx' > conftest.s
> > +    if { ac_try='$gcc_cv_as $gcc_cv_as_flags -32 -o conftest.o
> > +conftest.s
> > >&5'
> > +  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; }
> > +>&5
> > +  (eval $ac_try) 2>&5
> > +  ac_status=$?
> > +  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> > +  test $ac_status = 0; }; }
> > +    then
> > +	gcc_cv_as_mips_dot_module=yes
> > +    else
> > +      echo "configure: failed program was" >&5
> > +      cat conftest.s >&5
> > +    fi
> > +    rm -f conftest.o conftest.s
> > +  fi
> > +fi
> > +{ $as_echo "$as_me:${as_lineno-$LINENO}: result:
> > $gcc_cv_as_mips_dot_module" >&5
> > +$as_echo "$gcc_cv_as_mips_dot_module" >&6; } if test
> > +$gcc_cv_as_mips_dot_module = yes; then
> > +
> > +$as_echo "#define HAVE_AS_DOT_MODULE 1" >>confdefs.h
> > +
> > +fi
> > +
> >      { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for
> > .micromips support" >&5  $as_echo_n "checking assembler for .micromips
> > support... " >&6; }  if test "${gcc_cv_as_micromips_support+set}" =
> > set; then :
> > diff --git a/gcc/configure.ac b/gcc/configure.ac index
> > b9a3799..ded0c48 100644
> > --- a/gcc/configure.ac
> > +++ b/gcc/configure.ac
> > @@ -4251,6 +4251,13 @@ LCF0:
> >        [AC_DEFINE(HAVE_AS_GNU_ATTRIBUTE, 1,
> >  	  [Define if your assembler supports .gnu_attribute.])])
> >
> > +    gcc_GAS_CHECK_FEATURE([.module support],
> > +      gcc_cv_as_mips_dot_module,,[-32],
> > +      [.module mips2
> > +       .module fp=xx],,
> > +      [AC_DEFINE(HAVE_AS_DOT_MODULE, 1,
> > +	  [Define if your assembler supports .module.])])
> > +
> >      gcc_GAS_CHECK_FEATURE([.micromips support],
> >        gcc_cv_as_micromips_support,,[--fatal-warnings],
> >        [.set micromips],,
> > diff --git a/libgcc/config/mips/mips16.S b/libgcc/config/mips/mips16.S
> > index 6a43a98..dde8939 100644
> > --- a/libgcc/config/mips/mips16.S
> > +++ b/libgcc/config/mips/mips16.S
> > @@ -21,8 +21,12 @@ a copy of the GCC Runtime Library Exception along
> > with this program;  see the files COPYING3 and COPYING.RUNTIME
> > respectively.  If not, see  <http://www.gnu.org/licenses/>.  */
> >
> > -#ifdef __mips_micromips
> > -  /* DO NOTHING */
> > +#if defined(__mips_micromips) || defined(__mips_soft_float)
> > +  /* Do nothing because this code is only needed when linking
> > +     against mips16 hard-float objects.  Neither micromips code
> > +     nor soft-float code can be linked against mips16 hard-float
> > +     objects so we do not need these routines when building libgcc
> > +     for those cases.  */
> >  #else
> >
> >  /* This file contains mips16 floating point support functions.  These
> > @@ -749,4 +753,4 @@ CALL_STUB_RET (__mips16_call_stub_dc_10, 10, DC)
> > #endif /* !__mips_single_float */
> >
> >  #endif
> > -#endif /* __mips_micromips */
> > +#endif /* defined(__mips_micromips) || defined(__mips_soft_float) */
> > --
> > 2.2.1

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

* RE: [PATCH][4.9] PR 64569 - Backport support for MIPS binutils 2.25
  2015-01-26 18:04 [PATCH][4.9] PR 64569 - Backport support for MIPS binutils 2.25 Matthew Fortune
  2015-02-07  8:21 ` Matthew Fortune
@ 2015-02-17 20:10 ` Matthew Fortune
  2015-02-17 20:14   ` Jakub Jelinek
  1 sibling, 1 reply; 6+ messages in thread
From: Matthew Fortune @ 2015-02-17 20:10 UTC (permalink / raw)
  To: jakub
  Cc: Moore, Catherine (Catherine_Moore@mentor.com),
	'gcc-patches@gcc.gnu.org' (gcc-patches@gcc.gnu.org),
	aaro.koskinen

Ping. Please could you advise if I can approve MIPS changes to release branches
of if I need you/someone else to do so?

Thanks,
Matthew

> -----Original Message-----
> From: Matthew Fortune
> Sent: 07 February 2015 08:22
> To: jakub@redhat.com
> Cc: Moore, Catherine (Catherine_Moore@mentor.com); 'gcc-
> patches@gcc.gnu.org' (gcc-patches@gcc.gnu.org); aaro.koskinen@iki.fi
> Subject: RE: [PATCH][4.9] PR 64569 - Backport support for MIPS binutils
> 2.25
> 
> Hi Jakub,
> 
> I haven't done a backport to a release branch before. Could you tell me
> who needs to approve this change, it only affects MIPS?
> 
> Thanks,
> Matthew
> 
> > -----Original Message-----
> > From: Matthew Fortune
> > Sent: 26 January 2015 16:30
> > To: 'gcc-patches@gcc.gnu.org' (gcc-patches@gcc.gnu.org)
> > Cc: Moore, Catherine (Catherine_Moore@mentor.com)
> > Subject: RE: [PATCH][4.9] PR 64569 - Backport support for MIPS
> > binutils
> > 2.25
> >
> > > This is a minimal backport of features added to GCC 5 to enable use
> > > of binutils 2.25 with GCC 4.9 for MIPS soft-float builds. Further
> > > details in the PR:
> > >
> > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64569
> > >
> > > The commits which are being backported are listed below (the last
> > > one is posted but not committed yet).
> > >
> > > r213870: Fix mips16.S for soft-float
> > > r213872: Pass -m(soft|hard|single|double)-float via ASM_SPEC
> > > r217446: Implement o32 FPXX (very minimal backport)
> > > r217939: Update configure check for HAVE_MIPS_DOT_MODULE
> > > r??????: Make ASM_SPEC changes conditional on HAVE_MIPS_DOT_MODULE
> >
> > Updated - The last one in the list is committed as:
> > r219867: MIPS: Only pass floating-point options to the assembler when
> > necessary
> >
> > I'm not sure who to CC as RM for GCC 4.9.
> >
> > Thanks,
> > Matthew
> >
> > >
> > > gcc/
> > > 	* config.in [!USED_FOR_TARGET] (HAVE_AS_DOT_MODULE): Undefine.
> > > 	* config/mips/mips.h (FP_ASM_SPEC): New macro.
> > > 	(ASM_SPEC): Use FP_ASM_SPEC.
> > > 	* configure.ac (HAVE_AS_DOT_MODULE): Detect support for .module
> > > 	and FPXX extensions.
> > >
> > > libgcc/
> > > 	* config/mips/mips16.S: Do not build for soft-float.
> > >
> > > Once this is done I will do the same backport for GCC 4.8.
> > >
> > > Tested to check that soft-float builds work with binutils 2.25 and
> > > the floating-point options are not passed for binutils 2.24.
> > >
> > > Thanks,
> > > Matthew
> > >
> > > ---
> > >  gcc/config.in               |  6 ++++++
> > >  gcc/config/mips/mips.h      | 19 ++++++++++++++++++-
> > >  gcc/configure               | 32 ++++++++++++++++++++++++++++++++
> > >  gcc/configure.ac            |  7 +++++++
> > >  libgcc/config/mips/mips16.S | 10 +++++++---
> > >  5 files changed, 70 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/gcc/config.in b/gcc/config.in index 1e85325..013a606
> > > 100644
> > > --- a/gcc/config.in
> > > +++ b/gcc/config.in
> > > @@ -447,6 +447,12 @@
> > >  #endif
> > >
> > >
> > > +/* Define if the assembler understands .module. */ #ifndef
> > > +USED_FOR_TARGET #undef HAVE_AS_DOT_MODULE #endif
> > > +
> > > +
> > >  /* Define if your assembler supports the -no-mul-bug-abort option.
> > > */ #ifndef USED_FOR_TARGET  #undef HAVE_AS_NO_MUL_BUG_ABORT_OPTION
> > > diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index
> > > a786d4c..ff88d98 100644
> > > --- a/gcc/config/mips/mips.h
> > > +++ b/gcc/config/mips/mips.h
> > > @@ -1163,6 +1163,22 @@ struct mips_cpu_info {  #define
> > > SUBTARGET_ASM_SPEC ""
> > >  #endif
> > >
> > > +/* FP_ASM_SPEC represents the floating-point options that must be
> > passed
> > > +   to the assembler when FPXX support exists.  Prior to that point
> > the
> > > +   assembler could accept the options but were not required for
> > > +   correctness.  We only add the options when absolutely necessary
> > > +   because passing -msoft-float to the assembler will cause it to
> > reject
> > > +   all hard-float instructions which may require some user code to
> be
> > > +   updated.  */
> > > +
> > > +#ifdef HAVE_AS_DOT_MODULE
> > > +#define FP_ASM_SPEC "\
> > > +%{mhard-float} %{msoft-float} \
> > > +%{msingle-float} %{mdouble-float}"
> > > +#else
> > > +#define FP_ASM_SPEC
> > > +#endif
> > > +
> > >  #undef ASM_SPEC
> > >  #define ASM_SPEC "\
> > >  %{G*} %(endian_spec) %{mips1} %{mips2} %{mips3} %{mips4} \ @@
> > > -1188,7
> > > +1204,8 @@ struct mips_cpu_info {  %{mfp32} %{mfp64} %{mnan=*} \
> > > %{mshared} %{mno-shared} \  %{msym32} %{mno-sym32} \ -%{mtune=*} \
> > > +%{mtune=*}" \
> > > +FP_ASM_SPEC "\
> > >  %(subtarget_asm_spec)"
> > >
> > >  /* Extra switches sometimes passed to the linker.  */ diff --git
> > > a/gcc/configure b/gcc/configure index 291e463..d5b6879 100755
> > > --- a/gcc/configure
> > > +++ b/gcc/configure
> > > @@ -26140,6 +26140,38 @@ $as_echo "#define HAVE_AS_GNU_ATTRIBUTE 1"
> > > >>confdefs.h
> > >
> > >  fi
> > >
> > > +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for
> > > .module support" >&5
> > > +$as_echo_n "checking assembler for .module support... " >&6; } if
> > > +test "${gcc_cv_as_mips_dot_module+set}" = set; then :
> > > +  $as_echo_n "(cached) " >&6
> > > +else
> > > +  gcc_cv_as_mips_dot_module=no
> > > +  if test x$gcc_cv_as != x; then
> > > +    $as_echo '.module mips2
> > > +       .module fp=xx' > conftest.s
> > > +    if { ac_try='$gcc_cv_as $gcc_cv_as_flags -32 -o conftest.o
> > > +conftest.s
> > > >&5'
> > > +  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; }
> > > +>&5
> > > +  (eval $ac_try) 2>&5
> > > +  ac_status=$?
> > > +  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> > > +  test $ac_status = 0; }; }
> > > +    then
> > > +	gcc_cv_as_mips_dot_module=yes
> > > +    else
> > > +      echo "configure: failed program was" >&5
> > > +      cat conftest.s >&5
> > > +    fi
> > > +    rm -f conftest.o conftest.s
> > > +  fi
> > > +fi
> > > +{ $as_echo "$as_me:${as_lineno-$LINENO}: result:
> > > $gcc_cv_as_mips_dot_module" >&5
> > > +$as_echo "$gcc_cv_as_mips_dot_module" >&6; } if test
> > > +$gcc_cv_as_mips_dot_module = yes; then
> > > +
> > > +$as_echo "#define HAVE_AS_DOT_MODULE 1" >>confdefs.h
> > > +
> > > +fi
> > > +
> > >      { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for
> > > .micromips support" >&5  $as_echo_n "checking assembler for
> > > .micromips support... " >&6; }  if test
> > > "${gcc_cv_as_micromips_support+set}" = set; then :
> > > diff --git a/gcc/configure.ac b/gcc/configure.ac index
> > > b9a3799..ded0c48 100644
> > > --- a/gcc/configure.ac
> > > +++ b/gcc/configure.ac
> > > @@ -4251,6 +4251,13 @@ LCF0:
> > >        [AC_DEFINE(HAVE_AS_GNU_ATTRIBUTE, 1,
> > >  	  [Define if your assembler supports .gnu_attribute.])])
> > >
> > > +    gcc_GAS_CHECK_FEATURE([.module support],
> > > +      gcc_cv_as_mips_dot_module,,[-32],
> > > +      [.module mips2
> > > +       .module fp=xx],,
> > > +      [AC_DEFINE(HAVE_AS_DOT_MODULE, 1,
> > > +	  [Define if your assembler supports .module.])])
> > > +
> > >      gcc_GAS_CHECK_FEATURE([.micromips support],
> > >        gcc_cv_as_micromips_support,,[--fatal-warnings],
> > >        [.set micromips],,
> > > diff --git a/libgcc/config/mips/mips16.S
> > > b/libgcc/config/mips/mips16.S index 6a43a98..dde8939 100644
> > > --- a/libgcc/config/mips/mips16.S
> > > +++ b/libgcc/config/mips/mips16.S
> > > @@ -21,8 +21,12 @@ a copy of the GCC Runtime Library Exception along
> > > with this program;  see the files COPYING3 and COPYING.RUNTIME
> > > respectively.  If not, see  <http://www.gnu.org/licenses/>.  */
> > >
> > > -#ifdef __mips_micromips
> > > -  /* DO NOTHING */
> > > +#if defined(__mips_micromips) || defined(__mips_soft_float)
> > > +  /* Do nothing because this code is only needed when linking
> > > +     against mips16 hard-float objects.  Neither micromips code
> > > +     nor soft-float code can be linked against mips16 hard-float
> > > +     objects so we do not need these routines when building libgcc
> > > +     for those cases.  */
> > >  #else
> > >
> > >  /* This file contains mips16 floating point support functions.
> > > These @@ -749,4 +753,4 @@ CALL_STUB_RET (__mips16_call_stub_dc_10,
> > > 10, DC) #endif /* !__mips_single_float */
> > >
> > >  #endif
> > > -#endif /* __mips_micromips */
> > > +#endif /* defined(__mips_micromips) || defined(__mips_soft_float)
> > > +*/
> > > --
> > > 2.2.1

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

* Re: [PATCH][4.9] PR 64569 - Backport support for MIPS binutils 2.25
  2015-02-17 20:10 ` Matthew Fortune
@ 2015-02-17 20:14   ` Jakub Jelinek
  2015-02-26 11:36     ` Matthew Fortune
  0 siblings, 1 reply; 6+ messages in thread
From: Jakub Jelinek @ 2015-02-17 20:14 UTC (permalink / raw)
  To: Matthew Fortune
  Cc: Moore, Catherine (Catherine_Moore@mentor.com),
	'gcc-patches@gcc.gnu.org' (gcc-patches@gcc.gnu.org),
	aaro.koskinen

On Tue, Feb 17, 2015 at 08:10:37PM +0000, Matthew Fortune wrote:
> Ping. Please could you advise if I can approve MIPS changes to release branches
> of if I need you/someone else to do so?

Any maintainer or reviewer can approve changes to the release branches.  Of
course caution should be used, it should (with possible exceptions) meet the
branch criteria (regression bugfix or documentation fix) and it shouldn't be
something left broken on newer branches, in order to avoid creating
regressions on the trunk.

	Jakub

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

* RE: [PATCH][4.9] PR 64569 - Backport support for MIPS binutils 2.25
  2015-02-17 20:14   ` Jakub Jelinek
@ 2015-02-26 11:36     ` Matthew Fortune
  0 siblings, 0 replies; 6+ messages in thread
From: Matthew Fortune @ 2015-02-26 11:36 UTC (permalink / raw)
  To: Moore, Catherine (Catherine_Moore@mentor.com), aaro.koskinen
  Cc: Jakub Jelinek,
	'gcc-patches@gcc.gnu.org' (gcc-patches@gcc.gnu.org)

Jakub Jelinek <jakub@redhat.com> writes:
> On Tue, Feb 17, 2015 at 08:10:37PM +0000, Matthew Fortune wrote:
> > Ping. Please could you advise if I can approve MIPS changes to release
> > branches of if I need you/someone else to do so?
> 
> Any maintainer or reviewer can approve changes to the release branches.
> Of course caution should be used, it should (with possible exceptions)
> meet the branch criteria (regression bugfix or documentation fix) and it
> shouldn't be something left broken on newer branches, in order to avoid
> creating regressions on the trunk.

Thanks. I've committed this now albeit with a follow up commit owing to not
stating the bug number in the log.

I verified hard/soft defaults in GCC combined with binutils 2.24/2.25
successfully build a linux toolchain and the expected options appear to the
assembler. Obviously you can still face problems by updating Binutils
without rebuilding GCC but there is nothing I can (sensibly) do about that.

Aaro: Sorry for the long delay, I wasn't sure on procedure as you can see.

Any strong opinions on whether the combination of GCC 4.8 and binutils
2.25+ is significantly important? I can do the other backport if anyone
thinks it beneficial.

Thanks,
Matthew

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

* [PATCH][4.9] PR 64569 - Backport support for MIPS binutils 2.25
@ 2015-01-12 21:29 Matthew Fortune
  0 siblings, 0 replies; 6+ messages in thread
From: Matthew Fortune @ 2015-01-12 21:29 UTC (permalink / raw)
  To: 'gcc-patches@gcc.gnu.org' (gcc-patches@gcc.gnu.org)
  Cc: Moore, Catherine (Catherine_Moore@mentor.com)

This is a minimal backport of features added to GCC 5 to enable use
of binutils 2.25 with GCC 4.9 for MIPS soft-float builds. Further
details in the PR:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64569

The commits which are being backported are listed below (the last
one is posted but not committed yet).

r213870: Fix mips16.S for soft-float
r213872: Pass -m(soft|hard|single|double)-float via ASM_SPEC
r217446: Implement o32 FPXX (very minimal backport)
r217939: Update configure check for HAVE_MIPS_DOT_MODULE
r??????: Make ASM_SPEC changes conditional on HAVE_MIPS_DOT_MODULE

gcc/
	* config.in [!USED_FOR_TARGET] (HAVE_AS_DOT_MODULE): Undefine.
	* config/mips/mips.h (FP_ASM_SPEC): New macro.
	(ASM_SPEC): Use FP_ASM_SPEC.
	* configure.ac (HAVE_AS_DOT_MODULE): Detect support for .module
	and FPXX extensions.

libgcc/
	* config/mips/mips16.S: Do not build for soft-float.

Once this is done I will do the same backport for GCC 4.8.

Tested to check that soft-float builds work with binutils 2.25 and
the floating-point options are not passed for binutils 2.24.

Thanks,
Matthew

---
 gcc/config.in               |  6 ++++++
 gcc/config/mips/mips.h      | 19 ++++++++++++++++++-
 gcc/configure               | 32 ++++++++++++++++++++++++++++++++
 gcc/configure.ac            |  7 +++++++
 libgcc/config/mips/mips16.S | 10 +++++++---
 5 files changed, 70 insertions(+), 4 deletions(-)

diff --git a/gcc/config.in b/gcc/config.in
index 1e85325..013a606 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -447,6 +447,12 @@
 #endif
 
 
+/* Define if the assembler understands .module. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_AS_DOT_MODULE
+#endif
+
+
 /* Define if your assembler supports the -no-mul-bug-abort option. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_AS_NO_MUL_BUG_ABORT_OPTION
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index a786d4c..ff88d98 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -1163,6 +1163,22 @@ struct mips_cpu_info {
 #define SUBTARGET_ASM_SPEC ""
 #endif
 
+/* FP_ASM_SPEC represents the floating-point options that must be passed
+   to the assembler when FPXX support exists.  Prior to that point the
+   assembler could accept the options but were not required for
+   correctness.  We only add the options when absolutely necessary
+   because passing -msoft-float to the assembler will cause it to reject
+   all hard-float instructions which may require some user code to be
+   updated.  */
+
+#ifdef HAVE_AS_DOT_MODULE
+#define FP_ASM_SPEC "\
+%{mhard-float} %{msoft-float} \
+%{msingle-float} %{mdouble-float}"
+#else
+#define FP_ASM_SPEC
+#endif
+
 #undef ASM_SPEC
 #define ASM_SPEC "\
 %{G*} %(endian_spec) %{mips1} %{mips2} %{mips3} %{mips4} \
@@ -1188,7 +1204,8 @@ struct mips_cpu_info {
 %{mfp32} %{mfp64} %{mnan=*} \
 %{mshared} %{mno-shared} \
 %{msym32} %{mno-sym32} \
-%{mtune=*} \
+%{mtune=*}" \
+FP_ASM_SPEC "\
 %(subtarget_asm_spec)"
 
 /* Extra switches sometimes passed to the linker.  */
diff --git a/gcc/configure b/gcc/configure
index 291e463..d5b6879 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -26140,6 +26140,38 @@ $as_echo "#define HAVE_AS_GNU_ATTRIBUTE 1" >>confdefs.h
 
 fi
 
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .module support" >&5
+$as_echo_n "checking assembler for .module support... " >&6; }
+if test "${gcc_cv_as_mips_dot_module+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  gcc_cv_as_mips_dot_module=no
+  if test x$gcc_cv_as != x; then
+    $as_echo '.module mips2
+       .module fp=xx' > conftest.s
+    if { ac_try='$gcc_cv_as $gcc_cv_as_flags -32 -o conftest.o conftest.s >&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+    then
+	gcc_cv_as_mips_dot_module=yes
+    else
+      echo "configure: failed program was" >&5
+      cat conftest.s >&5
+    fi
+    rm -f conftest.o conftest.s
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_mips_dot_module" >&5
+$as_echo "$gcc_cv_as_mips_dot_module" >&6; }
+if test $gcc_cv_as_mips_dot_module = yes; then
+
+$as_echo "#define HAVE_AS_DOT_MODULE 1" >>confdefs.h
+
+fi
+
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .micromips support" >&5
 $as_echo_n "checking assembler for .micromips support... " >&6; }
 if test "${gcc_cv_as_micromips_support+set}" = set; then :
diff --git a/gcc/configure.ac b/gcc/configure.ac
index b9a3799..ded0c48 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -4251,6 +4251,13 @@ LCF0:
       [AC_DEFINE(HAVE_AS_GNU_ATTRIBUTE, 1,
 	  [Define if your assembler supports .gnu_attribute.])])
 
+    gcc_GAS_CHECK_FEATURE([.module support],
+      gcc_cv_as_mips_dot_module,,[-32],
+      [.module mips2
+       .module fp=xx],,
+      [AC_DEFINE(HAVE_AS_DOT_MODULE, 1,
+	  [Define if your assembler supports .module.])])
+
     gcc_GAS_CHECK_FEATURE([.micromips support],
       gcc_cv_as_micromips_support,,[--fatal-warnings],
       [.set micromips],,
diff --git a/libgcc/config/mips/mips16.S b/libgcc/config/mips/mips16.S
index 6a43a98..dde8939 100644
--- a/libgcc/config/mips/mips16.S
+++ b/libgcc/config/mips/mips16.S
@@ -21,8 +21,12 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
-#ifdef __mips_micromips
-  /* DO NOTHING */
+#if defined(__mips_micromips) || defined(__mips_soft_float)
+  /* Do nothing because this code is only needed when linking
+     against mips16 hard-float objects.  Neither micromips code
+     nor soft-float code can be linked against mips16 hard-float
+     objects so we do not need these routines when building libgcc
+     for those cases.  */
 #else
 
 /* This file contains mips16 floating point support functions.  These
@@ -749,4 +753,4 @@ CALL_STUB_RET (__mips16_call_stub_dc_10, 10, DC)
 #endif /* !__mips_single_float */
 
 #endif
-#endif /* __mips_micromips */
+#endif /* defined(__mips_micromips) || defined(__mips_soft_float) */
-- 
2.2.1

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

end of thread, other threads:[~2015-02-26 11:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-26 18:04 [PATCH][4.9] PR 64569 - Backport support for MIPS binutils 2.25 Matthew Fortune
2015-02-07  8:21 ` Matthew Fortune
2015-02-17 20:10 ` Matthew Fortune
2015-02-17 20:14   ` Jakub Jelinek
2015-02-26 11:36     ` Matthew Fortune
  -- strict thread matches above, loose matches on Subject: below --
2015-01-12 21:29 Matthew Fortune

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).