Subject: Failure in parallel make?

From: "Philip Rowlands" <[email-masked]>
Date: Tue, 18 Feb 2025 23:49:28 +0000

Using coreutils 9.6 on a vanilla Fedora 40 system, with no ./configure customizations,

This works:
$ make src/sort
...
$ src/sort --version
sort (GNU coreutils) 9.6

This fails:
$ ./configure && make -j2 src/sort
...
  GEN      src/version.c
  CC       lib/libcoreutils_a-hard-locale.o
  CC       lib/libcoreutils_a-hash.o
lib/hard-locale.c: In function 'hard_locale':
lib/hard-locale.c:30:15: error: 'SETLOCALE_NULL_MAX' undeclared (first use in this function); did you mean 'SETLOCALE_NULL_ALL_MTSAFE'?
   30 |   char locale[SETLOCALE_NULL_MAX];
      |               ^~~~~~~~~~~~~~~~~~
      |               SETLOCALE_NULL_ALL_MTSAFE
lib/hard-locale.c:30:15: note: each undeclared identifier is reported only once for each function it appears in
lib/hard-locale.c:32:7: error: implicit declaration of function 'setlocale_null_r' [-Wimplicit-function-declaration]
   32 |   if (setlocale_null_r (category, locale, sizeof (locale)))
      |       ^~~~~~~~~~~~~~~~
make: *** [Makefile:15454: lib/libcoreutils_a-hard-locale.o] Error 1
make: *** Waiting for unfinished jobs....

Let's try again:
$ make -j2 src/sort
  CC       src/sort.o
  CC       src/version.o
src/version.c:2:10: fatal error: version.h: No such file or directory
    2 | #include "version.h"
      |          ^~~~~~~~~~~
compilation terminated.
make: *** [Makefile:12848: src/version.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from src/sort.c:32:
src/system.h:41:10: fatal error: configmake.h: No such file or directory
   41 | #include "configmake.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:12848: src/sort.o] Error 1

$ make --version
GNU Make 4.4.1
Built for x86_64-redhat-linux-gnu

Is there a dependency problem in the generated Makefile? FWIW I see similar errors trying to build src/cp and src/mv.

src/sort$(EXEEXT): $(src_sort_OBJECTS) $(src_sort_DEPENDENCIES) $(EXTRA_src_sort_DEPENDENCIES) src/$(am__dirstamp)
        @rm -f src/sort$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(src_sort_OBJECTS) $(src_sort_LDADD) $(LIBS)
src/split.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
src/temp-stream.$(OBJEXT): src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)

Cheers,
Phil