Bug 276930 - [exp-run] ctfmerge return value change
Summary: [exp-run] ctfmerge return value change
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Package Infrastructure (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-09 19:15 UTC by Ed Maste
Modified: 2024-03-25 22:28 UTC (History)
1 user (show)

See Also:


Attachments
ctf* patch to fix return value (1.35 KB, patch)
2024-02-09 19:15 UTC, Ed Maste
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 2024-02-09 19:15:06 UTC
Created attachment 248291 [details]
ctf* patch to fix return value

https://reviews.freebsd.org/D43743 - I want to fix ctfmerge's return value. Currently it silently ignores errors. Fixing this might cause ports to break (because they start failing when ctf* fails) so requesting an exp-run.
Comment 2 Robert Clausecker freebsd_committer freebsd_triage 2024-02-13 20:53:27 UTC
I don't think ctfmerge should fail when there are no CTF sections to merge.  I mean, strip doesn't fail either if the file already has no symbol table.  It should instead just generate an output file with no CTF section.

This is related to bug #277036.
Comment 3 Ed Maste freebsd_committer freebsd_triage 2024-02-13 21:43:57 UTC
> I don't think ctfmerge should fail when there are no CTF sections to merge.

Indeed, I would as well argue that is a bug in ctfmerge.

That said, the current ctfmerge behaviour of silently ignoring errors is FreeBSD-specific hack, and there appears to be only one port that invokes ctf* when building without debug.
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-02-14 20:53:45 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=95ca89cda1a6c4e0ef0b3f765c6563f1db0d23fa

commit 95ca89cda1a6c4e0ef0b3f765c6563f1db0d23fa
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2024-02-14 14:48:42 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2024-02-14 20:53:11 +0000

    ctfmerge: demote "No ctf sections found" to a warning

    If there are no CTF sections then ctfmerge just has nothing to do; it
    should not be an error.

    Note that ctfmerge has an option to require CTF:
         -t      Make sure that all object files have a CTF section.

    Before this change, this option explicitly exited without error if none
    of the object files have CTF sections, with the comment:

        If we're verifying that C files have CTF, it's safe to
        assume that in this case, we're building only from assembly
        inputs.

    PR:             276930
    Reviewed by:    markj
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D43878

 cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
Comment 5 Ed Maste freebsd_committer freebsd_triage 2024-02-14 20:55:17 UTC
Thanks Antoine for the exp-run. Robert I have committed a fix to demote the "no CTF" case to a warning in ctfmerge, so you should be able to leave the port as-is if you so choose.
Comment 6 Robert Clausecker freebsd_committer freebsd_triage 2024-02-14 23:27:51 UTC
Hi Ed,

Thank you for the update.  Will leave the port unchanged then.
Comment 7 commit-hook freebsd_committer freebsd_triage 2024-03-25 22:28:12 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=49e126a03b6bebb17855fd830b2206c86f5eaa9a

commit 49e126a03b6bebb17855fd830b2206c86f5eaa9a
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2024-02-14 14:48:42 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2024-03-25 22:27:08 +0000

    ctfmerge: demote "No ctf sections found" to a warning

    If there are no CTF sections then ctfmerge just has nothing to do; it
    should not be an error.

    Note that ctfmerge has an option to require CTF:
         -t      Make sure that all object files have a CTF section.

    Before this change, this option explicitly exited without error if none
    of the object files have CTF sections, with the comment:

        If we're verifying that C files have CTF, it's safe to
        assume that in this case, we're building only from assembly
        inputs.

    PR:             276930
    Reviewed by:    markj
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D43878

    (cherry picked from commit 95ca89cda1a6c4e0ef0b3f765c6563f1db0d23fa)

 cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)