Re: [PATCH 2/2] Makefile: fix infinite recursion by dropping non-existent `%.output`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Sun, Sep 25, 2022 at 11:42:03AM +0100, Sergei Trofimovich wrote:
> Without the change GNU `make-4.4` falls into infinite recursion of trying
> to generate %.output files (bison is not passed flags to generate debug
> output).
> 
> This happens on GNU `make-4.4` only after GNU make change to more eagerly
> rebuild all target outputs in multiple targets:
>     https://savannah.gnu.org/bugs/index.php?63098
> 
> The recursion here is the following:
> 
> - Makefile depends on *.d files
> - *.d files depend on *.c files
> - *.c files are generated by bison
> - bison is triggered whenever some of it's multiple targets are missing
> 
> In our case `%.output` is always missing and bison is always reran.
> *.d files are always regenerated on `make` run. And make is always
> restarted as *.d files are always regenerated.
> 
> The fix removes infeasible `%.output`.
> 
> Signed-off-by: Sergei Trofimovich <slyich@xxxxxxxxx>

Huh, interesting.  That .output target seems to have been there since
the dawn of time, really can't remember why it was included in the
first place.

Anyway, both patches applied, thanks.

> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index e7a0dcb..d4e7551 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -384,7 +384,7 @@ clean: libfdt_clean pylibfdt_clean tests_clean
>  	@$(VECHO) LEX $@
>  	$(LEX) -o$@ $<
>  
> -%.tab.c %.tab.h %.output: %.y
> +%.tab.c %.tab.h: %.y
>  	@$(VECHO) BISON $@
>  	$(BISON) -b $(basename $(basename $@)) -d $<
>  

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux