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

Luis Machado luis.machado@arm.com
Fri Aug 12 14:45:32 GMT 2022


Hi Clément,


On 6/28/22 08:47, Clément Chigot via Binutils wrote:
> On Tue, Jun 28, 2022 at 9:27 AM Clément Chigot <chigot@adacore.com> wrote:
>>
>> Hi Nick,
>>
>> A few days ago, I've tried to open
>> https://sourceware.org/bugzilla/show_bug.cgi?id=25713
>> again because the new handling of Windows filename is triggering
>> issues for GNAT under MinGW.
>>
>> We've made the following changes attached. We aren't sure this
>> is the best solution, but it seems to work fine and it's what MinGW is
>> using internally.
>> If you find such a patch ok, I guess it would be logical to merge it
>> for 2.39.
> 
> Oops, I've pushed a patch which was a bit old and doesn't apply anymore...
> This version is better.
> 
> Sorry for the noise..
> 
> Thanks
> Clément

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


More information about the Binutils mailing list