diff --git a/src/binutils-fix-path-corruption.patch b/src/binutils-fix-path-corruption.patch new file mode 100644 index 0000000..cc6dd6e --- /dev/null +++ b/src/binutils-fix-path-corruption.patch @@ -0,0 +1,17 @@ +diff --git a/bfd/bfdio.c b/bfd/bfdio.c +index ea0d1389cd1..187763eb444 100644 +--- a/bfd/bfdio.c ++++ b/bfd/bfdio.c +@@ -189,11 +189,7 @@ _bfd_real_fopen (const char *filename, const char *modes) + } + + #ifdef __MINGW32__ +-#if !HAVE_DECL____LC_CODEPAGE_FUNC +- /* This prototype was added to locale.h in version 9.0 of MinGW-w64. */ +- _CRTIMP unsigned int __cdecl ___lc_codepage_func (void); +-#endif +- const unsigned int cp = ___lc_codepage_func (); ++ const unsigned int cp = CP_ACP; + #else + const unsigned int cp = CP_UTF8; + #endif diff --git a/src/gdb-fix-iconv-cp65001.patch b/src/gdb-fix-iconv-cp65001.patch new file mode 100644 index 0000000..ea203f7 --- /dev/null +++ b/src/gdb-fix-iconv-cp65001.patch @@ -0,0 +1,18 @@ +diff --git a/gdb/charset.c b/gdb/charset.c +index 5835fd40872..21d7ad03728 100644 +--- a/gdb/charset.c ++++ b/gdb/charset.c +@@ -1029,8 +1029,11 @@ _initialize_charset (void) + /* "CP" + x<=5 digits + paranoia. */ + static char w32_host_default_charset[16]; + +- snprintf (w32_host_default_charset, sizeof w32_host_default_charset, +- "CP%d", GetACP()); ++ if (GetACP () == CP_UTF8) ++ strncpy (w32_host_default_charset, "UTF-8", sizeof w32_host_default_charset); ++ else ++ snprintf (w32_host_default_charset, sizeof w32_host_default_charset, ++ "CP%d", GetACP()); + auto_host_charset_name = w32_host_default_charset; + auto_target_charset_name = auto_host_charset_name; + } diff --git a/src/gdb-fix-path-corruption.patch b/src/gdb-fix-path-corruption.patch new file mode 100644 index 0000000..cc6dd6e --- /dev/null +++ b/src/gdb-fix-path-corruption.patch @@ -0,0 +1,17 @@ +diff --git a/bfd/bfdio.c b/bfd/bfdio.c +index ea0d1389cd1..187763eb444 100644 +--- a/bfd/bfdio.c ++++ b/bfd/bfdio.c +@@ -189,11 +189,7 @@ _bfd_real_fopen (const char *filename, const char *modes) + } + + #ifdef __MINGW32__ +-#if !HAVE_DECL____LC_CODEPAGE_FUNC +- /* This prototype was added to locale.h in version 9.0 of MinGW-w64. */ +- _CRTIMP unsigned int __cdecl ___lc_codepage_func (void); +-#endif +- const unsigned int cp = ___lc_codepage_func (); ++ const unsigned int cp = CP_ACP; + #else + const unsigned int cp = CP_UTF8; + #endif