public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Rich Freeman <rich0@gentoo.org>
To: gentoo-dev <gentoo-dev@lists.gentoo.org>
Subject: Re: [gentoo-dev] Developers, please work on underlinking issues!
Date: Thu, 18 Aug 2016 08:12:18 -0400	[thread overview]
Message-ID: <CAGfcS_kS5Tio4FpTg4GMK4hyhSVEN7Kcdx7oaUV0hbBs1r0e-A@mail.gmail.com> (raw)
In-Reply-To: <943d47b7-f01a-480a-3bb6-c9ccf14f6cf9@gentoo.org>

On Thu, Aug 18, 2016 at 1:39 AM, Daniel Campbell <zlg@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


  parent reply	other threads:[~2016-08-18 12:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-17 20:37 [gentoo-dev] Developers, please work on underlinking issues! Michał Górny
2016-08-17 21:02 ` Ulrich Mueller
2016-08-18  5:39 ` Daniel Campbell
2016-08-18 10:26   ` Alexis Ballier
2016-08-18 12:12   ` Rich Freeman [this message]
2016-08-18 10:43 ` Andrew Savchenko
2016-08-18 11:47   ` Lars Wendler
2016-08-18 12:13     ` Rich Freeman
2016-08-18 13:21       ` Alexis Ballier
2016-08-18 21:20         ` Daniel Campbell
2016-08-18 21:56           ` Alexis Ballier
2016-08-18 23:49             ` Mart Raudsepp
2016-08-19  4:58         ` Michał Górny
2016-08-19  7:49           ` Rich Freeman
2016-08-19 15:18             ` james
2016-08-19 12:46           ` Alexis Ballier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGfcS_kS5Tio4FpTg4GMK4hyhSVEN7Kcdx7oaUV0hbBs1r0e-A@mail.gmail.com \
    --to=rich0@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox