From 4eff110a60cb9c7b77884c61f5925fe844c52acb Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Mon, 13 Jan 2025 23:56:38 +0000 Subject: 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 --- libasm/Makefile.am | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libasm') 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) -- cgit v1.2.3