diff options
author | Michael Pratt <[email protected]> | 2025-01-13 23:56:38 +0000 |
---|---|---|
committer | Mark Wielaard <[email protected]> | 2025-01-21 18:57:34 +0100 |
commit | 4eff110a60cb9c7b77884c61f5925fe844c52acb (patch) | |
tree | 4538147d63a33160f36fe49f975577e300c82639 /libasm | |
parent | 412ffac6e5a789d200677a84e7fe4b0e1e897e95 (diff) |
Replace usage of ar with stored library manifest files
The ar program is called to assemble a list of objects
within each archive to assist in building combined libraries,
however make already has this information
when processing the subdirectory for that respective library.
The list can be saved in a "manifest" file
instead of being generated whenever it is needed
for use with other subdirectories.
Even though the difference in time is insignificant,
a simple "echo" and "cat" is as much as 10 times faster
than a call to "ar t" for printing the archive members.
Since elfutils builds ar,
this also removes the awkward circular dependency
where an installation of ar is required
to build the libraries for ar.
Additionally, not every version of ar is equally portable,
as native versions of ar on macOS and other BSD-like distributions
may print out a special archive member like "__.SYMDEF"
which is not a compiled object but rather just metadata
from ranlib, leading to a build failure.
Avoid these limitations by removing usage of ar
and adding build and clean rules
for the usage of archive manifest files.
* .gitignore: exclude ".manifest" file extension.
* backends/Makefile.am: add manifest file build and clean rules.
* debuginfod/Makefile.am: Likewise.
* lib/Makefile.am: Likewise.
* libasm/Makefile.am: Likewise.
* libcpu/Makefile.am: Likewise.
* libdw/Makefile.am: Likewise,
and set object lists to manifest contents.
* libdwelf/Makefile.am: Likewise.
* libdwfl/Makefile.am: Likewise.
* libebl/Makefile.am: Likewise.
* libelf/Makefile.am: Likewise,
and set object lists to manifest contents.
* src/Makefile.am: Likewise.
Signed-off-by: Michael Pratt <[email protected]>
Diffstat (limited to 'libasm')
-rw-r--r-- | libasm/Makefile.am | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libasm/Makefile.am b/libasm/Makefile.am index 324fd095..969db935 100644 --- a/libasm/Makefile.am +++ b/libasm/Makefile.am @@ -87,5 +87,10 @@ noinst_HEADERS = libasmP.h symbolhash.h EXTRA_DIST = libasm.map +EXTRA_libasm_a_DEPENDENCIES = libasm.manifest + +libasm.manifest: $(libasm_a_OBJECTS) + $(AM_V_GEN)echo $^ > $@ + MOSTLYCLEANFILES = $(am_libasm_a_OBJECTS) $(am_libasm_pic_a_OBJECTS) libasm.so.$(VERSION) -CLEANFILES = libasm.so +CLEANFILES = libasm.so $(EXTRA_libasm_a_DEPENDENCIES) |