From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Subject: Re: [PATCH 2/2] Makefile: fix infinite recursion by dropping non-existent `%.output` Date: Mon, 26 Sep 2022 15:24:43 +1000 Message-ID: References: <20220925104203.648449-1-slyich@gmail.com> <20220925104203.648449-2-slyich@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lXJrbV2UxbAbKcbp" Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1664169917; bh=MiRgOx0B77RYwQhRH18I+9bDOIyoIqTl0DxAquuJXy8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UP+NiXU3FpvSJEPrt0ZJVRG0rF2AM5tYmcSk2a85l8kgzWyPbakFzP4WDKSy9OiiF kP22LbI6Ph6dM8gb7iN6PzcyuGetpD23W0PJJXjO4rR2phLcIwIHdHwmK7IxLxmkpw Mgc9QkgdMj9hO2Ow701ZghaQycLWUEjV7TrOPla4= Content-Disposition: inline In-Reply-To: <20220925104203.648449-2-slyich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> List-ID: To: Sergei Trofimovich Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org --lXJrbV2UxbAbKcbp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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). >=20 > 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 >=20 > The recursion here is the following: >=20 > - 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 >=20 > 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. >=20 > The fix removes infeasible `%.output`. >=20 > Signed-off-by: Sergei Trofimovich 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(-) >=20 > 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$@ $< > =20 > -%.tab.c %.tab.h %.output: %.y > +%.tab.c %.tab.h: %.y > @$(VECHO) BISON $@ > $(BISON) -b $(basename $(basename $@)) -d $< > =20 --=20 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 --lXJrbV2UxbAbKcbp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoULxWu4/Ws0dB+XtgypY4gEwYSIFAmMxN30ACgkQgypY4gEw YSJGxhAAkBif9IILjXloY9fdx2omq53/K8ue3leA5BDFpc3aHsucY820ZuOkCYfG IIRoK6GK4zuB8q7HH1iW9QMQCY2vOVzGJHOsAvRlqRBzgqu3qkWxuL6k/cIgmTAM OOwSsnUBboTWgdSi22pFE7zSpPQJtIb9qOVo/qQteP2guxOQVsBFtAJ4QRwjxfS6 es7/P3R2JHbulLQ9dq4iAGx2whopVQYVWF6R0qyXXehGfchVmQuRhIfgvMTy+Jvr Mn2LRVcYqEenlPSESKmvYhQbal+4Ho8YjxvpSwCC5EDkRqWqhmbXNYtwfY6rbdmV hNgqys8ERXcTXLIrmhXfP5aMfQD2mgHfT7yjqP/vFifNFeehddxyJeAnCTXw01Rz vH7j0xX0OaDOjk4KKg+u7t8vE9T5CtQmwvB6aO7LzVzQinZIheYhXBxXk1W+nHV4 GnbOIZVu/pUhkkq0XMoCWp2BI5wx7y6Mfv7knHVjzqsuhF4mB+zJ+T56FQ5YqD9c +VPTkEQlQxQTht4vsOx1gK975G1SY3eaJsovs0ohmRVOx+KHMYk84xr6s7zvS8G7 2s9ZOswcDTWS2MNGD14nZEqw11pbDWX43+v3tLjCnwDocqmEi/vKWm3kFkbHLiV3 ZTdTDcCAQHdxxsIZaCYJmoGBsXbpqp59onYD1qBH92BsupMfdK0= =yll2 -----END PGP SIGNATURE----- --lXJrbV2UxbAbKcbp--