From 0a3a9fa0c3ebf45c94d9009a59cead571cbecf7b Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 23 Sep 2021 17:20:45 -0400 Subject: ar linker: generate thin archives for uninstalled static libraries Since they will never be used outside of the build directory, they do not need to literally contain the .o files, and references will be sufficient. This covers a major use of object libraries, which is that the static library would potentially take up a lot of space by including another copy of every .o file. Fixes #9292 Fixes #8057 Fixes #2129 --- docs/markdown/snippets/uninstalled_static_linker.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 docs/markdown/snippets/uninstalled_static_linker.md (limited to 'docs') diff --git a/docs/markdown/snippets/uninstalled_static_linker.md b/docs/markdown/snippets/uninstalled_static_linker.md new file mode 100644 index 000000000..cd2e4b0c8 --- /dev/null +++ b/docs/markdown/snippets/uninstalled_static_linker.md @@ -0,0 +1,11 @@ +## More efficient static linking of uninstalled libraries + +A somewhat common use case of [[static_library]] is to create uninstalled +internal convenience libraries which are solely meant to be linked to other +targets. Some build systems call these "object libraries". Meson's +implementation does always create a static archive. + +This will now check to see if the static linker supports "thin archives" +(archives which do not contain the actual object code, only references to their +location on disk) and if so, use them to minimize space usage and speed up +linking. -- cgit v1.2.3