Created attachment 240784 [details] patch Reason: It is much easier to track port dependencies with shared libraries. It is also easier to develop depending projects since with static libs all binutils' dependencies should be also listed in all depending projects, which is inconvenient and error prone.
Tested this against all FLAVORS. It builds ok. I'm thinking this should be a default on option. This probably requires an exp-run before it's committed. I'll request that first before committing it. Also, the reason you suggest it not why we have shared libraries. Shared libraries are more secure because rebuilding only one package rather than every package makes securing from adhoc CVEs easier.
Created attachment 240803 [details] Only affect FLAVOR == native Reviewing this change, we do not want to install shared libraries for non-native architectures for cross-build purposes. This patch only affects FLAVOR == native. Note: sorting pkg-plist is a separate commit.
@yuri, Prior to 2f26d37a5937, binutils served a number of slave ports. The slave ports would not generate shared libraries while the native port did. However after 2f26d37a5937, shared libraries were removed. I think this was a mistake. Please test this patch and please also review the proposed commit log message. This is the correct patch (and commit log message).
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=6ccc29514e16e9d9b8ccc5da9ae4e74ff93953ea commit 6ccc29514e16e9d9b8ccc5da9ae4e74ff93953ea Author: Cy Schubert <cy@FreeBSD.org> AuthorDate: 2023-03-12 18:10:55 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2023-03-15 17:39:10 +0000 devel/binutils: Enable shared The submittor's reason for this change is that shared libraries makes dependencies easier to track. However, this is not the primary reason to add shared library support. Shared libraries are more secure because should a depending package, such as binutils, require a security update any depending packages will immediately reap the benefit of the newly secured package. This change only affects the native flavor because when 2f26d37a5937 (SVN r517642) changed the port from slave ports of binutils to FLAVORS, it mistakenly removed shared libraries from the native package. Prior to this 2f26d37a5937 only non-native packages were built producing only static libraries. This revision restores the behabviour of prior to 2f26d37a5937. PR: 270146 Reported by: yuri Fixes: 2f26d37a5937 (SVN r517642) devel/binutils/Makefile | 17 ++++++++++++++--- devel/binutils/pkg-plist | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 4 deletions(-)
Fixed.