[glibc] Makefile: Order the top-level stamp files before the subdirectory fan-out
Adhemerval Zanella via Glibc-cvs <[email protected]>
| Newsgroups | gmane.comp.lib.glibc.cvs |
|---|---|
| Message-ID | <[email protected]> |
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=25c42d04c45fc5fdb1481a7f968782791b21fd3e commit 25c42d04c45fc5fdb1481a7f968782791b21fd3e Author: Adhemerval Zanella <[email protected]> Date: Thu Aug 6 14:07:59 2026 -0300 Makefile: Order the top-level stamp files before the subdirectory fan-out The archive rules in Makerules list every stamp file as a prerequisite, including the top level's own, and the elf sub-make evaluates them to build libc_pic.a for the librtld.map link. A sub-make can only create the stamp files of its own directory, so when the top-level ones do not exist yet it fails with: make[2]: *** No rule to make target '.../stamp.os', needed by '.../libc_pic.a'. Stop. The serial recursion created them before the subdirectories through the prerequisite order of subdir_lib; the parallel recursion (commit 7cac99621e96) does not. Add them as prerequisites of the object-building per-subdirectory targets. Reviewed-by: Sam James <[email protected]> Diff: --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index b9fac6f47c..d559c42873 100644 --- a/Makefile +++ b/Makefile @@ -575,6 +575,14 @@ $(foreach t,$(+elf_last_subdir_targets),$(eval \ elf/$(t): $(addsuffix /$(t),$(filter-out elf,$(subdirs))))) endif +# The archive rules in Makerules list every stamp file as a +# prerequisite of libc_pic.a, which the elf sub-make evaluates for the +# librtld.map link, but a sub-make can only create its own directory's +# stamps. Create the top-level ones before the fan-out. +$(foreach t,$(+elf_last_subdir_targets),$(eval \ + $(addsuffix /$(t),$(subdirs)): \ + $(foreach o,$(object-suffixes-for-libc),$(common-objpfx)stamp$(o)))) + # Pass barriers: a subdirectory 'others' build links programs against # the libraries, so the 'lib' pass (including the top-level libc.so # link) must have completed.