MINGW-packages: binutils 2.36 breaks ar when running from command prompt
Just upgraded binutils. All uses of ar result in this message when running from command prompt:
c:\msys64\mingw64\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.
Minimal reproduction:
# From msys or git bash
touch empty.c
gcc -c -o empty.o empty.c
ar -rc libempty.a empty.o # Great success!
# Then from command prompt in the same folder
ar -rc libempty.a empty.o
Running the command from a git bash / msys 2prompt works. Running it from a cmd window gives the message. Running it in msys2 invoking cmd /c 'ar -rc [...]' works fine, and surprisingly also when invoking \msys64\usr\bin\bash -c "ar -rc [...]" from the command prompt
Downgrading to binutils 2.35.1-3 resolves the issue. Both 2.36-1 and 2.36-3 exhibit this behaviour.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 15 (7 by maintainers)
Commits related to this issue
- binutils: remove libdep.a which leads to errors when using ar Not sure if this needs to be fixed or just isn't useful on Windows. Fixes #7890 — committed to lazka/MINGW-packages by lazka 3 years ago
- binutils: remove libdep.a which leads to errors when using ar Not sure if this needs to be fixed or just isn't useful on Windows. Fixes #7890 — committed to mingwandroid/MINGW-packages by lazka 3 years ago
- binutils: remove libdep.a which leads to errors when using ar Not sure if this needs to be fixed or just isn't useful on Windows. Fixes #7890 — committed to danyeaw/MINGW-packages by lazka 3 years ago
- update binutils to 2.37 Note: binutils v2.37 fixes msys2/MINGW-packages#7023 and msys2/MINGW-packages#7890. — committed to Guyutongxue/mingw-builds by Guyutongxue 3 years ago
- `dc-chain`: Removing `libdep.a` BFD plugin for MinGW-w64. When this plugin exists, it breaks the `ar` utility on Windows. See: https://github.com/msys2/MINGW-packages/issues/7890 — committed to sizious/kos by sizious a year ago
Removed that plugin now. Sorry for the delay.
And here you are - upstream fix (to be a part of the next 2.37 release): https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=22604fe675b25b3ffca56e44f2c0ff378e5c6104.
FWIW that’s an entry in Bintuils’ bug-tracker - https://sourceware.org/bugzilla/show_bug.cgi?id=27113.