[issue37801] Compilation on MINGW64 fails (CODESET,wcstok,...)

2021-10-21 Thread Irit Katriel


Change by Irit Katriel :


--
resolution: duplicate -> wont fix

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37801] Compilation on MINGW64 fails (CODESET,wcstok,...)

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> MinGW is unsupported - close all open issues and list them here.

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37801] Compilation on MINGW64 fails (CODESET,wcstok,...)

2021-03-27 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10, Python 3.9 -Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37801] Compilation on MINGW64 fails (CODESET,wcstok,...)

2019-08-17 Thread Erik Janssens


Erik Janssens  added the comment:

fyi 1 : this issue pops up in multiple places, cfr :

 * bpo-35890
 * bpo-20596

the selection of the wcstok function is based on MS_WINDOWS being
defined, rather than eg. an autoconf check on which function is
available. 

fyi 2 : I've been able to cross compile 3.8 with mingw64 (gcc 7.3), but with a 
custom meson script instead of autoconf

--
nosy: +erikjanss

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37801] Compilation on MINGW64 fails (CODESET,wcstok,...)

2019-08-10 Thread Christoph Reiter


Christoph Reiter  added the comment:

> I wasn't aware that CPython builds for MSYS2 out of the box, since it's a 
> POSIX-on-Windows platform like Cygwin. Apparently there are patches that 
> enable it to build, since MSYS2 has Python available.

MSYS2 consists of a cygwin like environment and a mingw one. OP is trying to 
build with mingw.

MSYS2 contains a somewhat heavily patched Python in both environments so it's 
expected that building plain CPython doesn't work. There are plans to upstream 
smaller non-MSYS2 specific patches but nothing has come of it so far.

--
nosy: +lazka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37801] Compilation on MINGW64 fails (CODESET,wcstok,...)

2019-08-09 Thread Eryk Sun


Eryk Sun  added the comment:

I wasn't aware that CPython builds for MSYS2 out of the box, since it's a 
POSIX-on-Windows platform like Cygwin. Apparently there are patches that enable 
it to build, since MSYS2 has Python available.

For Windows, WCSTOK expands to wcstok_s, which takes a context pointer that 
allows concurrently parsing multiple strings in a single thread. The old 
function lacks this parameter and instead uses a per-thread static buffer. 
They're declared as follows:

wchar_t *wcstok(wchar_t *strToken, const wchar_t *strDelimit);
wchar_t *wcstok_s(wchar_t *str, const wchar_t *delimiters,
  wchar_t **context);

Otherwise the WCSTOK macro expands to wcstok, which assumes that POSIX systems 
use the standard definition [1]:

wchar_t *wcstok(wchar_t *restrict ws1, const wchar_t *restrict ws2,
wchar_t **restrict ptr);

Apparently the version of wcstok declared in your build environment takes only 
two arguments, like the old insecure function in Windows: 

wchar_t *__cdecl wcstok(wchar_t * __restrict__ _Str,
const wchar_t * __restrict__ _Delim)
__MINGW_ATTRIB_DEPRECATED_SEC_WARN;

[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/wcstok.html

--
nosy: +eryksun

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37801] Compilation on MINGW64 fails (CODESET,wcstok,...)

2019-08-09 Thread Steve Dower


Steve Dower  added the comment:

Guessing it needs an extra header file that is implicitly included in the 
Windows headers?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37801] Compilation on MINGW64 fails (CODESET,wcstok,...)

2019-08-09 Thread Emmanuel Arias


Change by Emmanuel Arias :


--
nosy: +eamanu

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37801] Compilation on MINGW64 fails (CODESET,wcstok,...)

2019-08-09 Thread Vadim Engelson


Vadim Engelson  added the comment:

(code from Python-3.8.0b3, but Python-3.7.2 had similar issues)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37801] Compilation on MINGW64 fails (CODESET,wcstok,...)

2019-08-09 Thread Vadim Engelson


New submission from Vadim Engelson :

Compilation on MINGW64 fails (CODESET,wcstok,...)
I am using the latest MINGW64 
(http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20190524.exe)
Versions: Python-3.7.2, Python-3.8.0b3

$ gcc -v
Using built-in specs.
COLLECT_GCC=C:\msys64\mingw64\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.1.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
gcc version 9.1.0 (Rev3, Built by MSYS2 project)

Result of make:

Python/initconfig.c: In function 'config_get_locale_encoding':
Python/initconfig.c:1427:28: error: implicit declaration of function 
'nl_langinfo' [-Werror=implicit-function-declaration]
 1427 | const char *encoding = nl_langinfo(CODESET);
  |^~~
Python/initconfig.c:1427:40: error: 'CODESET' undeclared (first use in this 
function); did you mean 'ECONNRESET'?
 1427 | const char *encoding = nl_langinfo(CODESET);
  |^~~
  |ECONNRESET
Python/initconfig.c:1427:40: note: each undeclared identifier is reported only 
once for each function it appears in
Python/initconfig.c: In function 'config_init_env_warnoptions':
Python/initconfig.c:1992:18: error: too many arguments to function 'wcstok'
 1992 | #  define WCSTOK wcstok
  |  ^~
Python/initconfig.c:2015:20: note: in expansion of macro 'WCSTOK'
 2015 | for (warning = WCSTOK(env, L",", );
  |^~
In file included from ./Include/Python.h:30,
 from Python/initconfig.c:1:
C:/msys64/mingw64/x86_64-w64-mingw32/include/string.h:147:20: note: declared 
here
  147 |   wchar_t *__cdecl wcstok(wchar_t * __restrict__ _Str,const wchar_t * 
__restrict__ _Delim) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
  |^~
Python/initconfig.c:1992:18: error: too many arguments to function 'wcstok'
 1992 | #  define WCSTOK wcstok
  |  ^~
Python/initconfig.c:2017:20: note: in expansion of macro 'WCSTOK'
 2017 |  warning = WCSTOK(NULL, L",", ))
  |^~
In file included from ./Include/Python.h:30,
 from Python/initconfig.c:1:
C:/msys64/mingw64/x86_64-w64-mingw32/include/string.h:147:20: note: declared 
here
  147 |   wchar_t *__cdecl wcstok(wchar_t * __restrict__ _Str,const wchar_t * 
__restrict__ _Delim) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
  |^~
cc1.exe: some warnings being treated as errors
make: *** [Makefile:1703: Python/initconfig.o] Error 1

--
components: Build, Interpreter Core, Windows
messages: 349282
nosy: paul.moore, steve.dower, tim.golden, vengelson, zach.ware
priority: normal
severity: normal
status: open
title: Compilation on MINGW64 fails (CODESET,wcstok,...)
type: compile error
versions: Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com