Parallel make bug in busybox
Denys Vlasenko
vda.linux at googlemail.com
Mon Aug 22 18:09:51 UTC 2016
On Mon, Aug 22, 2016 at 9:09 AM, Richard Purdie <rpurdie at rpsys.net> wrote:
> On Sun, 2016-08-21 at 22:03 +0200, Denys Vlasenko wrote:
>> On Fri, Aug 19, 2016 at 3:47 PM, Richard Purdie <rpurdie at rpsys.net>
>> wrote:
>> > Index: busybox-1.24.1/applets/applet_tables.c
>> > ===================================================================
>> > --- busybox-1.24.1.orig/applets/applet_tables.c
>> > +++ busybox-1.24.1/applets/applet_tables.c
>> > @@ -151,23 +151,15 @@ int main(int argc, char **argv)
>> > // printf("#define MAX_APPLET_NAME_LEN %u\n",
>> > MAX_APPLET_NAME_LEN);
>> >
>> > if (argv[2]) {
>> > - char line_old[80];
>> > char line_new[80];
>> > FILE *fp;
>> >
>> > - line_old[0] = 0;
>> > - fp = fopen(argv[2], "r");
>> > - if (fp) {
>> > - fgets(line_old, sizeof(line_old), fp);
>> > - fclose(fp);
>> > - }
>> > sprintf(line_new, "#define NUM_APPLETS %u\n",
>> > NUM_APPLETS);
>> > - if (strcmp(line_old, line_new) != 0) {
>> > - fp = fopen(argv[2], "w");
>> > - if (!fp)
>> > - return 1;
>> > - fputs(line_new, fp);
>> > - }
>> > + fp = fopen(argv[2], "w");
>> > + if (!fp)
>> > + return 1;
>> > + fputs(line_new, fp);
>> > + fclose(fp);
>>
>> This is done on purpose: if number of applets did not change, no need
>> to rebuild files which depend on NUM_APPLETS.h
>
> I appreciate the idea, however it doesn't work as the makefiles rely on
> timestamps of the dependent objects changing and the above code means
> the timestamps may or may not change. If they don't change, the rules
> can keep being re-triggered as far as I can tell.
Try changing any config option. Say,
-CONFIG_PASSWORD_MINLEN=6
+CONFIG_PASSWORD_MINLEN=5
Now make -j:
...
CC libbb/appletlib.o
CC libbb/lineedit.o
CC libbb/obscure.o
CC shell/ash.o
CC shell/hush.o
AR libbb/lib.a
AR shell/lib.a
LINK busybox_unstripped
...
lineedit and shells will be rebuilt on any such change.
More information about the busybox
mailing list