From: Howard Chu <hyc@symas.com>
To: Michael Matz <matz@suse.de>, binutils@sourceware.org
Subject: Re: [RFC] Move static archive dependencies into ld
Date: Mon, 5 Jun 2023 15:16:29 +0100 [thread overview]
Message-ID: <4b99cb5f-79a9-0a86-f675-81e4fa77e1b8@symas.com> (raw)
In-Reply-To: <3b124775-aa86-7e29-eba4-fbf07ffa0819@symas.com>
[-- Attachment #1: Type: text/plain, Size: 2485 bytes --]
What needs to happen to move this RFC forward? There seems to be at least some support for the idea (attached)
Howard Chu wrote:
> 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/
[-- Attachment #2: [PATCH] ld: build libdep plugin only when shared library support is enabled.eml --]
[-- Type: message/rfc822, Size: 1379 bytes --]
From: Howard Chu <hyc@symas.com>
To: "Clément Chigot" <chigot@adacore.com>, binutils@sourceware.org
Subject: Re: [PATCH] ld: build libdep plugin only when shared library support is enabled
Date: Thu, 13 Apr 2023 09:54:02 +0100
Message-ID: <5216d67e-ab2b-8142-edd8-4cab38ee2dc6@symas.com>
Clément Chigot via Binutils wrote:
> Otherwise, libtool will create a static plugin which cannot be loaded.
> Even worse on Windows, it will create a .a file, resulting in a similar
> bug than PR 27113: some tools will try to open it and Windows will raise
> a popup error.
At this point I think it'd be better to integrate the libdep functionality directly into ld, as suggested before:
https://sourceware.org/pipermail/binutils/2023-February/126155.html
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/
next prev parent reply other threads:[~2023-06-05 14:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-17 15:03 Michael Matz
2023-02-17 20:53 ` Howard Chu
2023-04-13 9:10 ` Clément Chigot
2023-06-05 14:16 ` Howard Chu [this message]
2023-06-05 15:32 ` Michael Matz
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=4b99cb5f-79a9-0a86-f675-81e4fa77e1b8@symas.com \
--to=hyc@symas.com \
--cc=binutils@sourceware.org \
--cc=matz@suse.de \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).