Skip to content

Using make's -j breaks the build #89

Description

@jendrikw

Originally found by a user of the AUR package: https://aur.archlinux.org/packages/agbcc

This is an example of the output when I run make -C gcc -j 16:

make: Entering directory '/tmp/agbcc/gcc'
gcc -g -std=gnu11 -Werror-implicit-function-declaration -Wno-error=incompatible-pointer-types  -I. -I. -c gengenrtl.c
gcc -MT rtl.o -MMD -MP -MF .d/rtl.Td -g -std=gnu11 -Werror-implicit-function-declaration -Wno-error=incompatible-pointer-types  -I. -I. -c rtl.c
gcc -MT bitmap.o -MMD -MP -MF .d/bitmap.Td -g -std=gnu11 -Werror-implicit-function-declaration -Wno-error=incompatible-pointer-types  -I. -I. -c bitmap.c
gcc -MT obstack.o -MMD -MP -MF .d/obstack.Td -g -std=gnu11 -Werror-implicit-function-declaration -Wno-error=incompatible-pointer-types  -I. -I. -c obstack.c
gcc -MT print-rtl.o -MMD -MP -MF .d/print-rtl.Td -g -std=gnu11 -Werror-implicit-function-declaration -Wno-error=incompatible-pointer-types  -I. -I. -c print-rtl.c
gcc -MT rtlanal.o -MMD -MP -MF .d/rtlanal.Td -g -std=gnu11 -Werror-implicit-function-declaration -Wno-error=incompatible-pointer-types  -I. -I. -c rtlanal.c
gcc -g -std=gnu11 -Werror-implicit-function-declaration -Wno-error=incompatible-pointer-types  -I. -I. -c gencheck.c
In file included from rtl.c:24:
rtl.h:1116:10: fatal error: genrtl.h: No such file or directory
 1116 | #include "genrtl.h"
      |          ^~~~~~~~~~
compilation terminated.
make: *** [Makefile:85: rtl.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from rtlanal.c:24:
rtl.h:1116:10: fatal error: genrtl.h: No such file or directory
 1116 | #include "genrtl.h"
      |          ^~~~~~~~~~
compilation terminated.
make: *** [Makefile:85: rtlanal.o] Error 1
In file included from bitmap.c:23:
rtl.h:1116:10: fatal error: genrtl.h: No such file or directory
 1116 | #include "genrtl.h"
      |          ^~~~~~~~~~
compilation terminated.
make: *** [Makefile:85: bitmap.o] Error 1
In file included from print-rtl.c:24:
rtl.h:1116:10: fatal error: genrtl.h: No such file or directory
 1116 | #include "genrtl.h"
      |          ^~~~~~~~~~
compilation terminated.
make: *** [Makefile:85: print-rtl.o] Error 1
mv -f .d/obstack.Td .d/obstack.d
make: Leaving directory '/tmp/agbcc/gcc'

I believe the problem is just incomplete dependency specifications in the makefile, probably because the DEPFLAGS thing is run only once and would have to account for some c files that are generated.

A workaround would be to use the special .NOTPARALLEL target (https://www.gnu.org/software/make/manual/html_node/Parallel-Disable.html).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions