Bug 2215028 - i686-w64-mingw32-ld internal error in compare_section
Summary: i686-w64-mingw32-ld internal error in compare_section
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: mingw-binutils
Version: rawhide
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Kalev Lember
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-06-14 14:00 UTC by John Berberian, Jr.
Modified: 2023-06-14 17:59 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-06-14 17:59:00 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
The minimized example code. (237.47 KB, application/zip)
2023-06-14 14:02 UTC, John Berberian, Jr.
no flags Details
Verbose compiler output: stdout (51.38 KB, text/plain)
2023-06-14 14:03 UTC, John Berberian, Jr.
no flags Details
Verbose compiler output: stderr (4.90 KB, text/plain)
2023-06-14 14:03 UTC, John Berberian, Jr.
no flags Details

Description John Berberian, Jr. 2023-06-14 14:00:56 UTC
When I try to compile my program with i686-w64-mingw32-gcc on rawhide, it fails and spits out an error from ld. The program links against NI's DAQmx library. While minimizing the example, I found that this bug occurs if both DAQmxStopTask() and DAQmxClearTask() are called.

I tried to compile the same program on Fedora 38, and it worked fine.

Reproducible: Always

Steps to Reproduce:
1. On rawhide, install mingw32-gcc-c++ and make. I did this in a docker container to ensure that my system's config wasn't causing this.
2. Extract the minimized example (attached).
3. make

Or use the included dockerfile (in example.zip) to perform all these steps for you. To demonstrate expected behavior, I've also included a copy of the dockerfile that uses Fedora 38 instead of rawhide.
Actual Results:  
The compilation fails with an error message:
/usr/lib/gcc/i686-w64-mingw32/13.1.1/../../../../i686-w64-mingw32/bin/ld: internal error: aborting at ../../ld/ldlang.c:527 in compare_section
/usr/lib/gcc/i686-w64-mingw32/13.1.1/../../../../i686-w64-mingw32/bin/ld: please report this bug

I've also recorded the output when -v -Wl,--verbose is added to the options list. It should be attached as verbose.out and verbose.err.

Expected Results:  
It should have compiled without error.

The broken version of i686-w64-mingw32-ld is 2.40-2.fc39. The working version is 2.39-7.fc38.

Both were running in docker containers - one using fedora:rawhide, the other using fedora:38.

Comment 1 John Berberian, Jr. 2023-06-14 14:02:15 UTC
Created attachment 1970869 [details]
The minimized example code.

Comment 2 John Berberian, Jr. 2023-06-14 14:03:27 UTC
Created attachment 1970870 [details]
Verbose compiler output: stdout

Comment 3 John Berberian, Jr. 2023-06-14 14:03:57 UTC
Created attachment 1970871 [details]
Verbose compiler output: stderr

Comment 4 Sandro Mani 2023-06-14 14:04:54 UTC
Can you please report this upstream at https://sourceware.org/bugzilla/?

Comment 5 Richard W.M. Jones 2023-06-14 14:20:05 UTC
I think it's likely to be this bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30079

Comment 6 John Berberian, Jr. 2023-06-14 14:36:45 UTC
Yes, that bug looks like it. I'm using an import library, and it works if I comment out all but one of them. I see a patch listed as a fix for that issue, could that be applied to rawhide?

Comment 7 Sandro Mani 2023-06-14 14:44:33 UTC
Building now: https://koji.fedoraproject.org/koji/taskinfo?taskID=102144295

Comment 8 Sandro Mani 2023-06-14 17:59:00 UTC
Should be fixed by mingw-binutils-2.40-3.fc39


Note You need to log in before you can comment on or make changes to this bug.