From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 488D613832E for ; Thu, 18 Aug 2016 12:12:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AE82521C08B; Thu, 18 Aug 2016 12:12:20 +0000 (UTC) Received: from mail-qt0-f196.google.com (mail-qt0-f196.google.com [209.85.216.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B58EBE0B1F for ; Thu, 18 Aug 2016 12:12:19 +0000 (UTC) Received: by mail-qt0-f196.google.com with SMTP id q11so1089035qtb.2 for ; Thu, 18 Aug 2016 05:12:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=H3/oddnzWK6xXK08w3U78Skph0gaVmWvXuo7es5/4ck=; b=K2KJ4nd8Zj0lyBMTv7XJyIOq6NQnUNJGWspBXsarLqXIPLxS/aNKtMXqW36IOJV2+I dsrVRhFCL/P73NwiapGmJ3sxyMOJcroeO1XvH3Otx5zmSTiTc/Trcbtemq616A5ku6rM 29MKTvWso52IVovMad/MOVo7iZ7LNS016m/NLyHP6NPTO6Xb1OFg06NLPXqeoi2x0rrA ng1bOAXpQZeA+t8ExLwVmtFoZP1XTH9OM5+GljbLIZfDmhSIrdaCunyR3ojaj6KSDnfa wGtJ18+ePPkefoBmicIz6OadKT8A75Lt8vPIzsLXlljGwE2ey3k6b7MiDR937qfbje2X s4Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=H3/oddnzWK6xXK08w3U78Skph0gaVmWvXuo7es5/4ck=; b=SGBrv6ebRgJ9ywVdW23D3WHBSXmNMAmQZyUR2o7mfXWakOyuR++jCXSsbJwtGFyzrH xJR3X25iAkvQw94hSQ5G7M7sF5uHKLggYk/W69V7kakq/Eqt4FooN9ED6JVFytYePNuG JjuRH4Jm/+KXRUwwnln0nEFejfRvhrjwEodz7OdyLIJ89YaoLYPP5Fo1F6txc8rLRnf6 rPN4suLJNmIkna8P8nXgVL17KcvHeZmVC7fteLF4sKrTl9l91CJI2DrMJBsUx+G/TSN+ ljIvxy68hXOS9j4oU3rQL8hblXKFhazCEUjEjjTh32+O9vCkNJ+2Af7hzYkdF3AKum4j ykmg== X-Gm-Message-State: AEkoouvpsqB4z091v+kekQHrGSRCkhclij3Ei8PtdgfQUw5z/YoXGRtsKFXsaZix3e4jzLTpHML0CITUBZFfnA== X-Received: by 10.237.53.125 with SMTP id b58mr1803425qte.104.1471522338653; Thu, 18 Aug 2016 05:12:18 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Sender: freemanrich@gmail.com Received: by 10.140.40.36 with HTTP; Thu, 18 Aug 2016 05:12:18 -0700 (PDT) In-Reply-To: <943d47b7-f01a-480a-3bb6-c9ccf14f6cf9@gentoo.org> References: <20160817223742.6ccff657.mgorny@gentoo.org> <943d47b7-f01a-480a-3bb6-c9ccf14f6cf9@gentoo.org> From: Rich Freeman Date: Thu, 18 Aug 2016 08:12:18 -0400 X-Google-Sender-Auth: CWrt5ztrVdolDfi_1KxxcaMAzNQ Message-ID: Subject: Re: [gentoo-dev] Developers, please work on underlinking issues! To: gentoo-dev Content-Type: text/plain; charset=UTF-8 X-Archives-Salt: 96025d38-3097-4869-8e5b-52866b1864ce X-Archives-Hash: 146a318e0d4f9d0d1e34cd843671209d On Thu, Aug 18, 2016 at 1:39 AM, Daniel Campbell 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