[klibc] Parallel build of dash still fails

H. Peter Anvin hpa at zytor.com
Tue Dec 13 09:29:02 PST 2005


Building dash in parallel still fails:

   GEN     dash/builtins.def
   HOSTCC  dash/mkinit
   HOSTCC  dash/mknodes
   HOSTCC  dash/mksignames
   HOSTCC  dash/mksyntax
dash/mksignames.c:59: warning: function declaration isn’t a prototype
dash/mksignames.c:365: warning: function declaration isn’t a prototype
dash/mksignames.c:386: warning: function declaration isn’t a prototype
   KLIBCCC dash/alias.o
cd dash; \
         bison -y -d /home/hpa/klibc/klibc.clean/dash/arith.y; \
         mv y.tab.c arith.c; \
         mv y.tab.h arith.h
cd dash; \
         bison -y -d /home/hpa/klibc/klibc.clean/dash/arith.y; \
         mv y.tab.c arith.c; \
         mv y.tab.h arith.h
   KLIBCCC dash/cd.o
dash/alias.c: In function ‘unaliascmd’:
dash/alias.c:162: warning: unused parameter ‘argc’
dash/alias.c:162: warning: unused parameter ‘argv’
   KLIBCCC dash/error.o
   KLIBCCC dash/eval.o
dash/cd.c:47:36: error: nodes.h: No such file or directory
In file included from dash/cd.c:48:
dash/jobs.h:102: warning: ‘union node’ declared inside parameter list
dash/jobs.h:102: warning: its scope is only this definition or 
declaration, which is probably not what you want
dash/jobs.h:103: warning: ‘union node’ declared inside parameter list
In file included from dash/cd.c:53:
dash/exec.h:74: warning: ‘union node’ declared inside parameter list
dash/cd.c: In function ‘cdcmd’:
dash/cd.c:88: warning: unused parameter ‘argc’
dash/cd.c:88: warning: unused parameter ‘argv’
dash/cd.c: In function ‘pwdcmd’:
dash/cd.c:259: warning: unused parameter ‘argc’
dash/cd.c:259: warning: unused parameter ‘argv’
make[2]: *** [dash/cd.o] Error 1
make[2]: *** Waiting for unfinished jobs....

... I'm pretty sure this is due to the rules of the following form ...

# Generate nodes{.c + .h}
quiet_cmd_mknodes = GEN     $@
       cmd_mknodes = cd $(obj); ./mknodes $(srctree)/$(src)/nodetypes \
                                $(srctree)/$(src)/nodes.c.pat
$(obj)/nodes.c $(obj)/nodes.h: $(obj)/mknodes $(src)/nodetypes \
                                $(src)/nodes.c.pat
         $(call cmd,mknodes)

... which DO NOT do what one logically think they do.  If executed in 
parallel that rule will be executed not once but *twice*, one for 
nodes.c and one for nodes.h, and they will of course step on each other. 
  One way to deal with that is to have a dummy rule from nodes.c to 
nodes.h, and another way is to have the program only output one file and 
not the other.

This particular misfeature is my #1 gripe with make, and has been. 
Unfortunately, the GNU make people don't seem willing to come up with a 
proper fix.

	-hpa



More information about the klibc mailing list