On Thu, Aug 18, 2016 at 1:39 AM, Daniel Campbell <z...@gentoo.org> wrote: > > Is it as simple as switching the linker and re-merging packages that one > maintains? Is gold supposed to be a big deal? Does it do the job of > linking better? I read the blog post and all but nobody's explaining > what gold does better than standard ld. >
There are a bunch of reasons why people prefer it for the long term. However, one of the biggest drives to get devs to use it is that it serves as a good canary for underlinking. If you underlink with the bfd linker the package will build and run fine typically, at least initially. However, down the road as libraries are updated you can run into problems. Since you didn't specify all your dependencies portage won't do rebuilds when they're necessary. My understanding is that if the needed libraries aren't even linked then even preserve-rebuild will fail. The package is basically relying on unspecified behavior to work. If you need a symbol you're supposed to link to the providing library, not just assume that it will happen to be around because some other library you're linked to happens to pull it in. The gold linker generates errors if you attempt to underlink, which turns this into a build-time error, and not a maybe-you-see-it-maybe-you-don't runtime issue for random users in six months. Correctly specifying dependencies and ensuring they're linked is of benefit to all users, and it will prevent subtle problems for users of the default bfd linker. At least, that is my understanding of the issue. It is entirely possible I missed something; I don't profess to be an ELF expert. :) -- Rich