"collect2.exe: error: ld returned 5 exit status" using the latest MinGW

It seems something went poof with the MSYS gcc somewhere between 2020-08-24 and 2020-09-05:


Is anyone else seeing issues here? I have not done any digging in to details yet.

See also “C:/Users/travis/build/TigerVNC/tigervnc/CMakeFiles/CMakeOutput.log”.
See also “C:/Users/travis/build/TigerVNC/tigervnc/CMakeFiles/CMakeError.log”.

So, what do they say? Can’t say anything without that.

Is it possible to access those without having to put up a custom build that prints them?

I got impatient and did a test build:


Unfortunately the log gives very little of value:

/C/tools/msys64/mingw64/bin/gcc.exe      -Wl,--whole-archive CMakeFiles/cmTC_50923.dir/objects.a -Wl,--no-whole-archive  -o cmTC_50923.exe -Wl,--out-implib,libcmTC_50923.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles/cmTC_50923.dir/linklibs.rsp
collect2.exe: error: ld returned 5 exit status

So ld is upset about something, but it doesn’t print what.

This looks like the same problem (1st in Google on “mingw “ld returned 5 exit status””):

In release version Qt add this flags " -Wl,-s,--relax,--gc-section ". I couldn’t find any information about “-s” flag, but due to this link i figured out that -gc-section flag was the reason of fail.

Seems something is amiss with MSYS binutils and CMake right now: