Fix PR 110085: `make clean` in GCC directory on sh target causes a failure

Message ID 20230605044112.2861212-1-apinski@marvell.com
State Accepted
Headers
Series Fix PR 110085: `make clean` in GCC directory on sh target causes a failure |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Andrew Pinski June 5, 2023, 4:41 a.m. UTC
  On sh target, there is a MULTILIB_DIRNAMES (or is it MULTILIB_OPTIONS) named m2,
this conflicts with the langauge m2. So when you do a `make clean`, it will remove
the m2 directory and then a build will fail. Now since r0-78222-gfa9585134f6f58,
the multilib directories are no longer created in the gcc directory as libgcc
was moved to the toplevel. So we can remove the part of clean that removes those
directories.

Tested on x86_64-linux-gnu and a cross to sh-elf that `make clean` followed by
`make` works again.

OK?

gcc/ChangeLog:

	PR bootstrap/110085
	* Makefile.in (clean): Remove the removing of
	MULTILIB_DIR/MULTILIB_OPTIONS directories.
---
 gcc/Makefile.in | 7 -------
 1 file changed, 7 deletions(-)
  

Comments

Richard Biener June 5, 2023, 5:23 a.m. UTC | #1
> Am 05.06.2023 um 06:42 schrieb Andrew Pinski via Gcc-patches <gcc-patches@gcc.gnu.org>:
> 
> On sh target, there is a MULTILIB_DIRNAMES (or is it MULTILIB_OPTIONS) named m2,
> this conflicts with the langauge m2. So when you do a `make clean`, it will remove
> the m2 directory and then a build will fail. Now since r0-78222-gfa9585134f6f58,
> the multilib directories are no longer created in the gcc directory as libgcc
> was moved to the toplevel. So we can remove the part of clean that removes those
> directories.
> 
> Tested on x86_64-linux-gnu and a cross to sh-elf that `make clean` followed by
> `make` works again.
> 
> OK?

Ok

> gcc/ChangeLog:
> 
>    PR bootstrap/110085
>    * Makefile.in (clean): Remove the removing of
>    MULTILIB_DIR/MULTILIB_OPTIONS directories.
> ---
> gcc/Makefile.in | 7 -------
> 1 file changed, 7 deletions(-)
> 
> diff --git a/gcc/Makefile.in b/gcc/Makefile.in
> index 1d39e6dd3f8..0c02f312985 100644
> --- a/gcc/Makefile.in
> +++ b/gcc/Makefile.in
> @@ -3622,13 +3622,6 @@ clean: mostlyclean lang.clean
>    -rm -f doc/*.pdf
> # Delete the include directories.
>    -rm -rf include include-fixed
> -# Delete files used by the "multilib" facility (including libgcc subdirs).
> -    -rm -f multilib.h tmpmultilib*
> -    -if [ "x$(MULTILIB_DIRNAMES)" != x ] ; then \
> -      rm -rf $(MULTILIB_DIRNAMES); \
> -    else if [ "x$(MULTILIB_OPTIONS)" != x ] ; then \
> -      rm -rf `echo $(MULTILIB_OPTIONS) | sed -e 's/\// /g'`; \
> -    fi ; fi
> 
> # Delete all files that users would normally create
> # while building and installing GCC.
> -- 
> 2.31.1
>
  
Andrew Pinski June 5, 2023, 5:43 a.m. UTC | #2
On Sun, Jun 4, 2023 at 10:24 PM Richard Biener via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
>
>
> > Am 05.06.2023 um 06:42 schrieb Andrew Pinski via Gcc-patches <gcc-patches@gcc.gnu.org>:
> >
> > On sh target, there is a MULTILIB_DIRNAMES (or is it MULTILIB_OPTIONS) named m2,
> > this conflicts with the langauge m2. So when you do a `make clean`, it will remove
> > the m2 directory and then a build will fail. Now since r0-78222-gfa9585134f6f58,
> > the multilib directories are no longer created in the gcc directory as libgcc
> > was moved to the toplevel. So we can remove the part of clean that removes those
> > directories.
> >
> > Tested on x86_64-linux-gnu and a cross to sh-elf that `make clean` followed by
> > `make` works again.
> >
> > OK?
>
> Ok

Is a similar patch ok for GCC 13 branch as we would get a similar
failure there too?

Thanks,
Andrew

>
> > gcc/ChangeLog:
> >
> >    PR bootstrap/110085
> >    * Makefile.in (clean): Remove the removing of
> >    MULTILIB_DIR/MULTILIB_OPTIONS directories.
> > ---
> > gcc/Makefile.in | 7 -------
> > 1 file changed, 7 deletions(-)
> >
> > diff --git a/gcc/Makefile.in b/gcc/Makefile.in
> > index 1d39e6dd3f8..0c02f312985 100644
> > --- a/gcc/Makefile.in
> > +++ b/gcc/Makefile.in
> > @@ -3622,13 +3622,6 @@ clean: mostlyclean lang.clean
> >    -rm -f doc/*.pdf
> > # Delete the include directories.
> >    -rm -rf include include-fixed
> > -# Delete files used by the "multilib" facility (including libgcc subdirs).
> > -    -rm -f multilib.h tmpmultilib*
> > -    -if [ "x$(MULTILIB_DIRNAMES)" != x ] ; then \
> > -      rm -rf $(MULTILIB_DIRNAMES); \
> > -    else if [ "x$(MULTILIB_OPTIONS)" != x ] ; then \
> > -      rm -rf `echo $(MULTILIB_OPTIONS) | sed -e 's/\// /g'`; \
> > -    fi ; fi
> >
> > # Delete all files that users would normally create
> > # while building and installing GCC.
> > --
> > 2.31.1
> >
  
Richard Biener June 5, 2023, 6:33 a.m. UTC | #3
On Mon, Jun 5, 2023 at 7:43 AM Andrew Pinski <pinskia@gmail.com> wrote:
>
> On Sun, Jun 4, 2023 at 10:24 PM Richard Biener via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
> >
> >
> >
> > > Am 05.06.2023 um 06:42 schrieb Andrew Pinski via Gcc-patches <gcc-patches@gcc.gnu.org>:
> > >
> > > On sh target, there is a MULTILIB_DIRNAMES (or is it MULTILIB_OPTIONS) named m2,
> > > this conflicts with the langauge m2. So when you do a `make clean`, it will remove
> > > the m2 directory and then a build will fail. Now since r0-78222-gfa9585134f6f58,
> > > the multilib directories are no longer created in the gcc directory as libgcc
> > > was moved to the toplevel. So we can remove the part of clean that removes those
> > > directories.
> > >
> > > Tested on x86_64-linux-gnu and a cross to sh-elf that `make clean` followed by
> > > `make` works again.
> > >
> > > OK?
> >
> > Ok
>
> Is a similar patch ok for GCC 13 branch as we would get a similar
> failure there too?

Yes, though I wonder if we should worry.

Richard.

> Thanks,
> Andrew
>
> >
> > > gcc/ChangeLog:
> > >
> > >    PR bootstrap/110085
> > >    * Makefile.in (clean): Remove the removing of
> > >    MULTILIB_DIR/MULTILIB_OPTIONS directories.
> > > ---
> > > gcc/Makefile.in | 7 -------
> > > 1 file changed, 7 deletions(-)
> > >
> > > diff --git a/gcc/Makefile.in b/gcc/Makefile.in
> > > index 1d39e6dd3f8..0c02f312985 100644
> > > --- a/gcc/Makefile.in
> > > +++ b/gcc/Makefile.in
> > > @@ -3622,13 +3622,6 @@ clean: mostlyclean lang.clean
> > >    -rm -f doc/*.pdf
> > > # Delete the include directories.
> > >    -rm -rf include include-fixed
> > > -# Delete files used by the "multilib" facility (including libgcc subdirs).
> > > -    -rm -f multilib.h tmpmultilib*
> > > -    -if [ "x$(MULTILIB_DIRNAMES)" != x ] ; then \
> > > -      rm -rf $(MULTILIB_DIRNAMES); \
> > > -    else if [ "x$(MULTILIB_OPTIONS)" != x ] ; then \
> > > -      rm -rf `echo $(MULTILIB_OPTIONS) | sed -e 's/\// /g'`; \
> > > -    fi ; fi
> > >
> > > # Delete all files that users would normally create
> > > # while building and installing GCC.
> > > --
> > > 2.31.1
> > >
  

Patch

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 1d39e6dd3f8..0c02f312985 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3622,13 +3622,6 @@  clean: mostlyclean lang.clean
 	-rm -f doc/*.pdf
 # Delete the include directories.
 	-rm -rf include include-fixed
-# Delete files used by the "multilib" facility (including libgcc subdirs).
-	-rm -f multilib.h tmpmultilib*
-	-if [ "x$(MULTILIB_DIRNAMES)" != x ] ; then \
-	  rm -rf $(MULTILIB_DIRNAMES); \
-	else if [ "x$(MULTILIB_OPTIONS)" != x ] ; then \
-	  rm -rf `echo $(MULTILIB_OPTIONS) | sed -e 's/\// /g'`; \
-	fi ; fi
 
 # Delete all files that users would normally create
 # while building and installing GCC.