From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zmcc-3-mx.zmailcloud.com (zmcc-3-mx.zmailcloud.com [34.200.143.36]) by sourceware.org (Postfix) with ESMTPS id 0FCAE385828E for ; Fri, 17 Feb 2023 20:53:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0FCAE385828E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=symas.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=symas.com Received: from zmcc-3.zmailcloud.com (183.87.154.104.bc.googleusercontent.com [104.154.87.183]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by zmcc-3-mx.zmailcloud.com (Postfix) with ESMTPS id C999040529; Fri, 17 Feb 2023 14:55:13 -0600 (CST) Received: from zmcc-3.zmailcloud.com (localhost [127.0.0.1]) by zmcc-3-mta-1.zmailcloud.com (Postfix) with ESMTPS id 87EE08036361; Fri, 17 Feb 2023 14:53:44 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by zmcc-3-mta-1.zmailcloud.com (Postfix) with ESMTP id 76F868036362; Fri, 17 Feb 2023 14:53:44 -0600 (CST) Received: from zmcc-3.zmailcloud.com ([127.0.0.1]) by localhost (zmcc-3-mta-1.zmailcloud.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id KAXH5Q1Q-fXW; Fri, 17 Feb 2023 14:53:44 -0600 (CST) Received: from [192.168.1.107] (ip-84-203-24-251.broadband.digiweb.ie [84.203.24.251]) by zmcc-3-mta-1.zmailcloud.com (Postfix) with ESMTPSA id EAE8D80363CD; Fri, 17 Feb 2023 14:53:43 -0600 (CST) Subject: Re: [RFC] Move static archive dependencies into ld To: Michael Matz , binutils@sourceware.org References: From: Howard Chu Message-ID: <3b124775-aa86-7e29-eba4-fbf07ffa0819@symas.com> Date: Fri, 17 Feb 2023 20:53:41 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.15 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP,URIBL_RED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Michael Matz via Binutils wrote: > Hello, > > this is an RFC for now. When met with some acceptance I'll cobble up a > similar thing for gold as well and then make the libdep.so plugin only > emit a warning message that its functionality is obsoleted and moved > into ld itself. As Cary put it back in 2020 when the plugin was added: > > ( https://sourceware.org/pipermail/binutils/2020-December/114536.html ) > > "Did I miss any discussion about whether this feature should/could be > implemented directly in the linkers, rather than via a plugin? I > wouldn't be opposed to it." I'm all for it. I went the plugin route initially because it seemed the easiest way to get the feature written and accepted but I agree with you, it'd be much more useful if it was implicitly supported by default. > > I pretty much think that yes, the functionality absolutely needs to be in > the linker itself, not in a plugin, at least if we want to see some use of > it in the real world. Amusingly I was triggered to look into this by > libbfd itself: Recently it got a dependency to libsframe and when > shipping only static archives to build against (which we as distro > consciously do) that leads to build errors in various 3rdparty packages > wanting to link against libbfd (no matter how bad an idea that is). Now, > adding a '-plugin $magicdir/libdep.so' to the build flags of each such > package is no better than just adding '-lsframe' in each case, so the > plugin really doesn't help anything. Had the functionality already been > in the linker itself we could have just added > "--record-libdeps='-lsframe'" when building libbfd.a and be done with it. > > So, let's try to prepare for the future and at least now make ld interpret > such dependencies on its own. > > So, what do people think? > > > Ciao, > Michael. > > --------------------------------------- > > needing a plugin to interpret static archive dependencies (as added > by 'ar --record-libdeps') effectively means they are unused. > Which is too bad, because they are actually useful. So implement > them in ld itself. -- -- Howard Chu CTO, Symas Corp. http://www.symas.com Director, Highland Sun http://highlandsun.com/hyc/ Chief Architect, OpenLDAP http://www.openldap.org/project/