Hide Forgot
mingw-crt failed to build from source in Red Hat Enterprise Linux 9 CentOS Stream https://kojihub.stream.rdu2.redhat.com//koji/taskinfo?taskID=247569 For details on the mass rebuild see: Please fix mingw-crt at your earliest convenience and set the bug's status to ASSIGNED when you start fixing it.
mingw-* packages in RHEL 9 (not 8) are mine.
This is actually a bug in mingw-binutils. The 'ar' tool crashes: (gdb) bt #0 __GI___fileno (fp=0x0) at fileno.c:35 #1 0x0000000000482e81 in ar_save () at ../../binutils/arsup.c:358 #2 yyparse.isra.0 () at /usr/src/debug/mingw-binutils-2.34-8.el9.x86_64/build_win32/binutils/arparse.y:131 #3 0x0000000000403cdb in mri_emul () at ../../binutils/ar.c:179 #4 main (argc=<optimized out>, argv=<optimized out>) at ../../binutils/ar.c:778
This is caused by the following downstream patch that we added for a CVE: Subject: [PATCH] binutils: Make smart_rename safe too Actually it's not even used in Fedora mingw-binutils. Since RHEL 9 binutils has moved to 2.35 (vs mingw-binutils 2.34) I am going to synchronize this with binutils
Actually no the bogus patch is also present in RHEL 9 binutils (binutils-CVE-2021-20197.patch). I don't think we can fix this for mingw-binutils until this patch can be fixed.
I suspect that the problem is also related to: https://sourceware.org/bugzilla/show_bug.cgi?id=27456
(In reply to Nick Clifton from comment #6) Sorry, I meant this PR: https://sourceware.org/bugzilla/show_bug.cgi?id=27270
Created attachment 1775641 [details] Proposed patch Hi Rich, Are you able to try out this patch and see if it solves the problem ? Cheers Nick
I can. Actually I went about it in a different way - I manually fixed up commit 6184480d7ce1bc on top of mingw-binutils 2.34 and I'm testing that out at the moment. Your patch looks really very different though - is it derived from something else upstream?
(In reply to Richard W.M. Jones from comment #9) > I can. > > Actually I went about it in a different way - I manually fixed up > commit 6184480d7ce1bc on top of mingw-binutils 2.34 and I'm testing > that out at the moment. > > Your patch looks really very different though - is it derived from > something else upstream? Yes - it is based on comparing the very latest version of the upstream sources of the files affected (arsup.c, rename.c, etc) with the current c9s sources. If I remember correctly the fix for 27270 works, but also causes some build problems on Windows machines, and with recent versions of gcc and clang. Hence I thought that synchronizing might be best. If your solution works, and presumably is simpler, then lets go with that. I am all for keeping things simple. Cheers Nick
Since my fix seems to be OK, I went with that: https://gitlab.com/redhat/centos-stream/rpms/mingw-binutils/-/merge_requests/1
Restore assignee that appears to have been accidentally reset when the component was changed (comment 3).
Checked mingw-crt and mingw-binutils package, both have been built successfully: mingw-crt-8.0.0-3.el9:https://kojihub.stream.rdu2.redhat.com//koji/buildinfo?buildID=5458. mingw-binutils-2.34-9.el9:https://kojihub.stream.rdu2.redhat.com//koji/buildinfo?buildID=7285.
The bug has been fixed as mingw-crt and mingw-binutils have been built successfully: mingw-crt-8.0.0-3.el9:https://kojihub.stream.rdu2.redhat.com//koji/buildinfo?buildID=5458. mingw-binutils-2.34-9.el9:https://kojihub.stream.rdu2.redhat.com//koji/buildinfo?buildID=7285.