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.
Created attachment 1970869 [details] The minimized example code.
Created attachment 1970870 [details] Verbose compiler output: stdout
Created attachment 1970871 [details] Verbose compiler output: stderr
Can you please report this upstream at https://sourceware.org/bugzilla/?
I think it's likely to be this bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30079
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?
Building now: https://koji.fedoraproject.org/koji/taskinfo?taskID=102144295
Should be fixed by mingw-binutils-2.40-3.fc39