[PATCH] bfd: handle codepage when opening files on MinGW
Clément Chigot
chigot@adacore.com
Fri Aug 12 15:11:12 GMT 2022
Hi Luis,
> It's been reported to me that this is causing some issues building binutils with mingw.
>
> In fact, trying to build master binutils-gdb with Ubuntu 22.04's mingw-w64 8.0 or Ubuntu 20.04's mingw-w64 7.0.0 runs
> into the following:
>
> bfd/bfdio.c: In function ‘_bfd_real_fopen’:
> bfd/bfdio.c:125:28: error: implicit declaration of function ‘___lc_codepage_func’ [-Werror=implicit-function-declaration]
> 125 | const unsigned int cp = ___lc_codepage_func();
Looking at the commit exposing this ___lc_codepage_func, it seems to have
been integrated only after 8.0.1 (cf
https://github.com/mirror/mingw-w64/commit/64cb5e8582d9004cfa4d90b189c80c6e1a35d7af)
I don't know if there is any define providing the version of MinGW (I
didn't find it).
Otherwise, I guess it'll have to be checked by the configure.
I won't have time to create a patch for that before next week (probably on
wednesday/thursday). Meanwhile, you should be able to recompile binutils
without this patch. As long as you don't have non-ASCII characters in your
filename, you should be fine.
But thanks for bringing that up !
Clément
More information about the Binutils
mailing list