[Buildroot] [git commit branch/2022.02.x] Makefile: really generate glibc locales in parallel

Peter Korsgaard peter at korsgaard.com
Thu Nov 3 13:48:40 UTC 2022


commit: https://git.buildroot.net/buildroot/commit/?id=9bb4f83a08956ed0a038b53b3d4b3244ab974ee8
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/2022.02.x

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: 6fbdf5159607 (Makefile: Parallelize glibc locale generation)

Signed-off-by: Yann E. MORIN <yann.morin at orange.com>
Cc: Gleb Mazovetskiy <glex.spb at gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
(cherry picked from commit 4164ed24f277b24096ab065aa85b7de9d0c80c02)
Signed-off-by: Peter Korsgaard <peter at korsgaard.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 93125e16a6..03f2154f9f 100644
--- a/Makefile
+++ b/Makefile
@@ -664,7 +664,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)



More information about the buildroot mailing list