You can see here: https://github.com/python/cpython/blob/master/Makefile.pre.in#L708 that regen-importlib is building a binary from .o files which are built from .c and .h files, which are, at the same time, regenerated by other regen- targets. This does cause build errors in heavily parallelized builds, we've been seeing it regularly in Yocto Project lately: https://bugzilla.yoctoproject.org/show_bug.cgi?id=12596 I tried to see if I can easily correct target dependencies in the makefile, but couldn't figure it out. So, a workaround, for us, would be to issue 'make regen-importlib' ahead of other things: make regen-importlib make regen-all
May I ask why you are running the regen-all target at all? A normal end-user build of CPython does not need make regen-all. It's only used for CI and internal development.