question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Avoid thin archives

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
eli-schwartzcommented, Oct 28, 2021

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.

0reactions
nathanaelgcommented, Oct 28, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found