Makefile: really generate glibc locales in parallel

To generate the glibc locale data, we call into a recursive Makefile,
so as to generate locales in parallel. This is done as part of a
target-finalize hook.

However, that hook is registered after all packages have been parsed,
and as such, it maye be registered after hooks defined in packages.

Furthermore, the expansion of target-finalize hooks is done in a recipe,
so it is not easy to understand whether this generates a "simple" rule
or not.

As a consequence, despite the use of $(MAKE), make may not notice that
the command is a recursive call, and will decide to close the jobserver
file-descriptors, yielding warnings like:
    make[2]: warning: jobserver unavailable: using -j1.  Add '+' to
    parent make rule.

This causes the lcoale data to not be generated in parallel, which is
initially all the fuss about using a sub-makefile...

So, do as suggested, and prepend the hook with a '+', so that it is
explicit to make that it should not close its jobserver fds.

Fixes: 6fbdf51596 (Makefile: Parallelize glibc locale generation)

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Cc: Gleb Mazovetskiy <glex.spb@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This commit is contained in:
yann.morin@orange.com 2022-10-14 13:18:25 +02:00 committed by Yann E. MORIN
parent 2c9ef36242
commit 4164ed24f2

View File

@ -653,7 +653,7 @@ ifneq ($(GLIBC_GENERATE_LOCALES),)
PACKAGES += host-localedef
define GENERATE_GLIBC_LOCALES
$(MAKE) -f support/misc/gen-glibc-locales.mk \
+$(MAKE) -f support/misc/gen-glibc-locales.mk \
ENDIAN=$(call LOWERCASE,$(BR2_ENDIAN)) \
LOCALES="$(GLIBC_GENERATE_LOCALES)" \
Q=$(Q)