lib: Fix parallel library build ordering#276
Open
luca-fancellu wants to merge 1 commit into
Open
Conversation
When building with --enable-elf-shlibs, Makefile.elf-lib adds `all:: image` to build the shared library image. The static library stub also adds `all:: subdirs $(LIBRARY).a`. The archive and ELF image are consumed through the top-level lib directory by other subdirectories, so a library subdirectory must not return from "make all" before both outputs have been created. If libcom_err.so has not been created yet, libext2fs.so can fall back to libcom_err.a. On x86-64 that can fail because lib/et/error_message.o contains a thread-local object and the non-PIC static object has R_X86_64_TPOFF32 relocations that cannot be used when linking a shared object. Make the static archive target depend on the ELF image when Makefile.elf-lib is included, so the normal library build creates the shared object and top-level `.so` symlinks before returning to the parent recursive make. lib/ss has an additional ordering issue: its first local all:: rule only names mk_cmds, while libss.a and ss.pc are added later. Put libss.a and ss.pc on that first all:: target rule as well so lib/ss cannot complete after generating only mk_cmds and leave debugfs without lib/ss/ss_err.h. Also make ss_err.h depend on ss_err.c so parallel consumers do not run compile_et twice for the same generated pair. Finally, create the lib/ss install directories in the install recipe before copying headers and data files. The ELF shared-library fragment also contributes install and installdirs double-colon rules, so relying on the aggregate installdirs target can still let the header copy run before $(includedir)/ss exists during parallel install. Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm currently building with a 56 core machine and hitting these issues with master branch, commit 43643a5.
Fixes and reasoning are in the patch.
Using these configure parameters:
And then
make -j56:Logs:
configure.log
make.log