[Buildroot] [PATCH 2/3] package/dvb-apps: is not parallel-safe

Trent Piepho tpiepho at impinj.com
Tue Nov 28 19:09:03 UTC 2017


On Mon, 2017-11-27 at 23:52 +0100, Peter Korsgaard wrote:
> > > > > > "Yann" == Yann E MORIN <yann.morin.1998 at free.fr> writes:
> 
>  > This is invisible because the timings make it excessively difficult to
>  > hit, but the Makefile is inherently flawed for parallel build, as it
>  > contains:
> 
>  >     $(objects): atsc_psip_section.c atsc_psip_section.h
> 
>  >     atsc_psip_section.c atsc_psip_section.h:
>  >         perl section_generate.pl atsc_psip_section.pl
> 
>  > and the perl script section_generate.pl will create both the .c and .h
>  > files in one go, but given the construct above, there can be two such
>  > script that run in parallel, which can clobber the generated .c and/or
>  > .h files.

I gather this is the common parallel build issue with a recipe that
produces two outputs. This can be fixed by using a pattern rule for the
recipe that produces multiple outputs.

%section.c %section.h: %section.pl
	perl section_generate.pl $<

GNU make understands a pattern rule that produces multiple outputs to
produce all of them via a single running of the rule.

Seems like a simple patch.


More information about the buildroot mailing list