Bug 271405 - devel/binutils abort() in mingw32
Summary: devel/binutils abort() in mingw32
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Cy Schubert
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-14 04:08 UTC by Stephen Hurd
Modified: 2023-05-14 15:22 UTC (History)
0 users

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


Attachments
Upstream patch to resolve abort() in mingw32. (502 bytes, text/plain)
2023-05-14 04:08 UTC, Stephen Hurd
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen Hurd freebsd_committer freebsd_triage 2023-05-14 04:08:02 UTC
Created attachment 242158 [details]
Upstream patch to resolve abort() in mingw32.

With mingw32-binutils build 2.40_3,1 on 13.2-RELEASE, I get an abort() in ld.

This appears to have been fixed upstream with this commit:
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=b7eab2a9d4f4e92692daf14b09fc95ca11b72e30;hp=0d2f72332c7606fa3181b54dceef82d1af403624

Build log without the patch available here:
https://gitlab.synchro.net/main/sbbs/-/jobs/53734

With the patch:
https://gitlab.synchro.net/main/sbbs/-/jobs/53735

I've attached the file I put in my files dir, which is just the linked upstream commitdiff.

The error at the end of the failing log is:
/usr/local/lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld: internal error: aborting at ldlang.c:527 in int compare_section(sort_type, asection *, asection *)
/usr/local/lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld: please report this bug
Comment 1 commit-hook freebsd_committer freebsd_triage 2023-05-14 05:03:35 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=783bf3a6159aadc5696192e040abae2c311c8b8c

commit 783bf3a6159aadc5696192e040abae2c311c8b8c
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2023-05-14 04:50:30 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2023-05-14 04:50:30 +0000

    devel/binutils: Fix abort() in mingw32

    Building mingw32 results in a binutils abort() trap. Upstream commit
    b7eab2a9d4f fixes this. Upstream commit log message states:

        the early-out in wild_sort is not enough, it might still be
        that filenames are equal _and_ the wildcard list doesn't specify
        a sort order either.  Don't call compare_section then.

    PR:                     271405
    Reported by:            shurd
    Upstream commit:        b7eab2a9d4f (identified by shurd)
    MFH                     2023Q3

 devel/binutils/Makefile                      |  2 +-
 devel/binutils/files/patch-ld_ldlang.c (new) | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-05-14 05:25:39 UTC
A commit in branch 2023Q2 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=18b00e31b24344d2b72e32d56174015ae8b91fe7

commit 18b00e31b24344d2b72e32d56174015ae8b91fe7
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2023-05-14 04:50:30 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2023-05-14 05:25:25 +0000

    devel/binutils: Fix abort() in mingw32

    Building mingw32 results in a binutils abort() trap. Upstream commit
    b7eab2a9d4f fixes this. Upstream commit log message states:

        the early-out in wild_sort is not enough, it might still be
        that filenames are equal _and_ the wildcard list doesn't specify
        a sort order either.  Don't call compare_section then.

    PR:                     271405
    Reported by:            shurd
    Upstream commit:        b7eab2a9d4f (identified by shurd)

    (cherry picked from commit 783bf3a6159aadc5696192e040abae2c311c8b8c)

 devel/binutils/Makefile                      |  2 +-
 devel/binutils/files/patch-ld_ldlang.c (new) | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)
Comment 3 Cy Schubert freebsd_committer freebsd_triage 2023-05-14 15:22:38 UTC
Thanks for the pointer to the patch.