modula-2, make: Do not declare m2.pod .INTERMEDIATE

Message ID 20261011132538.37431-1-iain@sandoe.co.uk
State Committed
Commit 93bcb5098e398d2df50c125a11978ac435680ebd
Headers
Series modula-2, make: Do not declare m2.pod .INTERMEDIATE |

Commit Message

Iain Sandoe Oct. 11, 2026, 1:25 p.m. UTC
  As discussed at the Cauldron .. 
Tested on x86_64-linux/darwin, OK for trunk?
thanks, Iain.

--- 8< ---

It appears that make 3.81 has a latent bug that is triggered by a combination
of modula2 build recipe entries that appear to be correct.  In particular
marking the m2.pod file as .INTERMEDIATE produces a situation which a clean
build of the compiler works, as does any non-parallel rebuild.  However any
parallel rebuild results in make spinning with a single process at 100%.

Other similar recipes in Fortran and D appear to work as expected, there is
some subtle difference in the m2 case.

The solution that works to allow a rebuild with j > 1 is to remove the
.INTERMEDIATE marking on the m2.pod (and to make it explictly deleted on
clean).

gcc/m2/ChangeLog:

	* Make-lang.in: Do not mark m2.pod as .INTERMEDIATE but delete it
	explicitly in clean targets.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
---
 gcc/m2/Make-lang.in | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

Gaius Mulley Oct. 12, 2026, 10:21 p.m. UTC | #1
Iain Sandoe <iains.gcc@gmail.com> writes:

> As discussed at the Cauldron .. 
> Tested on x86_64-linux/darwin, OK for trunk?
> thanks, Iain.

yes lgtm - many thanks!

regards,
Gaius


> --- 8< ---
>
> It appears that make 3.81 has a latent bug that is triggered by a combination
> of modula2 build recipe entries that appear to be correct.  In particular
> marking the m2.pod file as .INTERMEDIATE produces a situation which a clean
> build of the compiler works, as does any non-parallel rebuild.  However any
> parallel rebuild results in make spinning with a single process at 100%.
>
> Other similar recipes in Fortran and D appear to work as expected, there is
> some subtle difference in the m2 case.
>
> The solution that works to allow a rebuild with j > 1 is to remove the
> .INTERMEDIATE marking on the m2.pod (and to make it explictly deleted on
> clean).
>
> gcc/m2/ChangeLog:
>
> 	* Make-lang.in: Do not mark m2.pod as .INTERMEDIATE but delete it
> 	explicitly in clean targets.
>
> Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
> ---
>  gcc/m2/Make-lang.in | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/gcc/m2/Make-lang.in b/gcc/m2/Make-lang.in
> index d7c46ec1a19..e4f37a155b9 100644
> --- a/gcc/m2/Make-lang.in
> +++ b/gcc/m2/Make-lang.in
> @@ -189,8 +189,6 @@ m2.install-pdf: $(M2_PDFFILES)
>  	  $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/gcc/$$f"; \
>  	done
>  
> -.INTERMEDIATE: m2.pod
> -
>  m2.pod: $(TEXISRC) | $(objdir)/m2/images/gnu.eps $(TEXILIBSRC)
>  	-$(TEXI2POD) -I $(objdir)/m2 -D m2 < $< > $@
>  
> @@ -412,6 +410,7 @@ endif
>  
>  m2.mostlyclean:
>  	-rm -f m2/*.o
> +	-rm -f m2.pod
>  
>  m2.clean:
>  	-rm -f m2/*.o
  

Patch

diff --git a/gcc/m2/Make-lang.in b/gcc/m2/Make-lang.in
index d7c46ec1a19..e4f37a155b9 100644
--- a/gcc/m2/Make-lang.in
+++ b/gcc/m2/Make-lang.in
@@ -189,8 +189,6 @@  m2.install-pdf: $(M2_PDFFILES)
 	  $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/gcc/$$f"; \
 	done
 
-.INTERMEDIATE: m2.pod
-
 m2.pod: $(TEXISRC) | $(objdir)/m2/images/gnu.eps $(TEXILIBSRC)
 	-$(TEXI2POD) -I $(objdir)/m2 -D m2 < $< > $@
 
@@ -412,6 +410,7 @@  endif
 
 m2.mostlyclean:
 	-rm -f m2/*.o
+	-rm -f m2.pod
 
 m2.clean:
 	-rm -f m2/*.o