Avoid thin archives
See original GitHub issueDescribe the bug
After updating to 0.60.0 I started seeing some errors when linking against static archives linked by meson 0.60.0 error adding symbols: malformed archive
Comparing the ninja files between 0.59.3 and 0.60.0 show the only difference is a T
option added to the LINK_ARGS and the resulting static archive is very small. Is there a way of avoiding this behaviour? I understand when you’re building a static archive to then use immediately in the same project you might want a thin archive but if I just want to build a normal static archive there doesn’t seem to be a way to do so. Also shouldn’t the new behaviour be opt in rather than the default? I can imagine this might break quite a few existing meson scripts.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Turn thin archive into normal one - Stack Overflow
I'm building V8, and by default it builds as a "thin" archive, where the .a files essentially just contain pointers to the object...
Read more >Support thin archives for static libraries that are not installed
I have a project which generates several executables which (partially) share the same source files. Since each executable is first compiled ...
Read more >[dpdk-dev] [PATCH] buildtools: fix build with meson 0.60
Handle thin archives when invoking pmdinfogen by directly using the files ... to avoid creating temporary directories in vain when all archives are...
Read more >D116979 [llvm-ar] Add --thin for creating a thin archive
For portability, 'T' with thin archive semantics should be avoided. ... We have many users who are using thin archives, and will be...
Read more >reg. thin archives - Google Groups
A thin archive is a .a file that only stores filename references to .o files, not their contents. You can edit out/Debug/build.ninja find ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It should be noted that apparently thin archives do not play nicely with nvcc (the CUDA compiler) when passing static libraries to a custom target, the use case of which has prompted someone to submit a PR adding a
thin: <bool>
keyword to force disable it.I still think hooking up the install layer (and automatically using it in the conan recipe) is a bit nicer / more idiomatic, plus it works everywhere, including the 0.60.0 release.
Yup seems perfectly reasonable, just not something I was aware of because it did just work until this point! I will add the installation stuff in any projects which are outputting libraries.