Bug 270146 - devel/binutils: Build and install shared libraries
Summary: devel/binutils: Build and install shared libraries
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Cy Schubert
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-12 07:33 UTC by Yuri Victorovich
Modified: 2023-03-17 18:44 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (cy)


Attachments
patch (2.03 KB, patch)
2023-03-12 07:33 UTC, Yuri Victorovich
no flags Details | Diff
Only affect FLAVOR == native (3.61 KB, patch)
2023-03-13 00:01 UTC, Cy Schubert
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2023-03-12 07:33:26 UTC
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.
Comment 1 Cy Schubert freebsd_committer freebsd_triage 2023-03-12 19:20:55 UTC
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.
Comment 2 Cy Schubert freebsd_committer freebsd_triage 2023-03-13 00:01:56 UTC
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.
Comment 3 Cy Schubert freebsd_committer freebsd_triage 2023-03-15 17:37:27 UTC
@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).
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-03-15 17:41:07 UTC
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(-)
Comment 5 Cy Schubert freebsd_committer freebsd_triage 2023-03-17 18:44:54 UTC
Fixed.