[PATCH] bfd: handle codepage when opening files on MinGW

Nick Clifton nickc@redhat.com
Mon Aug 15 11:07:48 GMT 2022

Hi Luis,

> 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();

So that would imply a missing #include of a system header, yes ?

Do you know which header provides the required prototype ?

The code is currently conditional upon __MINGW32__ being defined.  Perhaps
that check needs to be extended/changed to reference a different preprocessor
symbol ?


More information about the Binutils mailing list