mingw-distro icon indicating copy to clipboard operation
mingw-distro copied to clipboard

binutils 2.41 still complains about `libdep.a`

Open StephanTLavavej opened this issue 3 years ago • 5 comments

Two users have independently reported that building different projects (Lua, wxWidgets) fails with a dialog box complaining:

c:\mingw\lib\bfd-plugins\libdep.a is either not designed to run on Windows or it contains an error. Try installing the program again using the original installation media or contact your system administrator or the software vendor for support. Error status 0xc000012f.

This appears to have been fixed upstream as https://sourceware.org/bugzilla/show_bug.cgi?id=27113 . However, I'm not 100% certain, because that bug and fix talks about libdep.dll.a. (The difference may be that I build the distro statically.)

It would be helpful to:

  • Get a minimal, self-contained repro (I don't want to try building Lua or wxWidgets)
  • Verify whether the trunk version of binutils makes this problem go away
  • If it doesn't, verify whether deleting libdep.a makes this problem go away (as I can easily add that to the build script)

StephanTLavavej avatar Dec 15 '21 09:12 StephanTLavavej

Minimal reproduction:

echo. > empty.c
gcc -c -o empty.o empty.c
ar -rc libempty.a empty.o

alexzyp avatar Mar 07 '22 06:03 alexzyp

binutils 2.38 has been released and contains the claimed fix, so I just need to build it.

StephanTLavavej avatar Mar 12 '22 10:03 StephanTLavavej

Still repros with binutils 2.41.

StephanTLavavej avatar Feb 01 '24 01:02 StephanTLavavej

Hi @StephanTLavavej I've been working around this for years. But sadly, do not know how to repair it. When I build GCC for embedded targets like arm, avr or others on MSys2, I need to actually delete the plugins folder. This is because the plugins load libdep.a and that program (regardless of how I build binutils) wants to load some DLLs dynamically.

I use your standalone MinGW EVN for building since your GCC is dependency-free, which is rare.

Unfortunatley, I have not yet found the place in source code where the program dynamically loads and remain still doing workarounds like this.

ckormanyos avatar Feb 06 '24 14:02 ckormanyos

This should be reported upstream to binutils.

StephanTLavavej avatar Feb 11 '24 14:02 StephanTLavavej