Addresses #10616. Please see the commit messages and note that AR/RANLIB may need to be set manually!
This is testing the waters for LTO. There are a few unknowns:
- A boost LTO issue was addressed here, but others may remain for different libs/versions
- ar/ranlib detection will likely turn out to be annoying
- Not yet tested with Gitian
I propose adding this as-is (maybe after Gitian testing), and seeking feedback. I suspect that there will be quite a few platforms/toolchains where it’s broken, but there’s only so much we can do about it.