I was advised to bring this issue here, but I am not sure that mingw-w64
is 'wrong' in this case.

Original issue is https://github.com/msys2/CLANG-packages/issues/21

When building python against UCRT, its configure script fails to find
mktime, resulting in the mktime function being absent from the time
module.  The reason for this is that the configure test is explicitly
checking for a symbol that it can link to.  MSVCRT exports mktime as well
as _mktime32 and _mktime64, but UCRT only exports _mktime32 and _mktime64
and provides mktime as an inline function.


https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/mktime-mktime32-mktime64?view=msvc-160
says:
"""
mktime is an inline function that is equivalent to _mktime64, unless
_USE_32BIT_TIME_T is defined, in which case it is equivalent to _mktime32.
"""

Which is why I don't know that mingw-w64 is wrong here, it is doing
exactly what MS says.  However, it could provide aliases in
ucrtbase.def.in for the 'base' functions to make configure happy.

It appears that other time functions are also affected (time and ctime
were just reported on that issue).
configure:13740: checking for mktime
configure:13740: x86_64-w64-mingw32-gcc -o conftest.exe -march=x86-64 
-mtune=generic -O2 -pipe -fwrapv -D__USE_MINGW_ANSI_STDIO=1 
-D_WIN32_WINNT=0x0601 -DNDEBUG  -D__USE_MINGW_ANSI_STDIO=1 
-IC:/msys64/ucrt64/include/ncurses  -pipe conftest.c  >&5
C:/msys64/ucrt64/lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
 C:\msys64\tmp\ccR6jA14.o:conftest.c:(.text.startup+0xa): undefined reference 
to `mktime'
collect2.exe: error: ld returned 1 exit status
configure:13740: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define _GNU_SOURCE 1
| #define _NETBSD_SOURCE 1
| #define __BSD_VISIBLE 1
| #define _DARWIN_C_SOURCE 1
| #define _PYTHONFRAMEWORK ""
| #define _XOPEN_SOURCE 700
| #define _XOPEN_SOURCE_EXTENDED 1
| #define _POSIX_C_SOURCE 200809L
| #define HAVE_STDIO_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_WCHAR_H 1
| #define HAVE_SYS_TIME_H 1
| #define STDC_HEADERS 1
| #define _ALL_SOURCE 1
| #define _DARWIN_C_SOURCE 1
| #define _GNU_SOURCE 1
| #define _HPUX_ALT_XOPEN_SOCKET_API 1
| #define _NETBSD_SOURCE 1
| #define _OPENBSD_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1
| #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
| #define __STDC_WANT_IEC_60559_DFP_EXT__ 1
| #define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1
| #define __STDC_WANT_IEC_60559_TYPES_EXT__ 1
| #define __STDC_WANT_LIB_EXT2__ 1
| #define __STDC_WANT_MATH_SPEC_FUNCS__ 1
| #define _TANDEM_SOURCE 1
| #define __EXTENSIONS__ 1
| #define Py_ENABLE_SHARED 1
| #define HAVE_CONIO_H 1
| #define HAVE_DIRECT_H 1
| #define HAVE_ERRNO_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_IEEEFP_H 1
| #define HAVE_IO_H 1
| #define HAVE_PROCESS_H 1
| #define HAVE_SIGNAL_H 1
| #define HAVE_UTIME_H 1
| #define HAVE_SYS_FILE_H 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_DIRENT_H 1
| #define _LARGEFILE_SOURCE 1
| #define _FILE_OFFSET_BITS 64
| #if defined(SCO_DS)
| #undef _OFF_T
| #endif
| #define RETSIGTYPE void
| #define uid_t int
| #define gid_t int
| #define HAVE_SSIZE_T 1
| #define HAVE_GCC_UINT128_T 1
| #define SIZEOF_INT 4
| #define SIZEOF_LONG 4
| #define SIZEOF_LONG_LONG 8
| #define SIZEOF_VOID_P 8
| #define SIZEOF_SHORT 2
| #define SIZEOF_FLOAT 4
| #define SIZEOF_DOUBLE 8
| #define SIZEOF_FPOS_T 8
| #define SIZEOF_SIZE_T 8
| #define SIZEOF_PID_T 8
| #define SIZEOF_UINTPTR_T 8
| #define HAVE_LONG_DOUBLE 1
| #define SIZEOF_LONG_DOUBLE 16
| #define SIZEOF__BOOL 1
| #define SIZEOF_OFF_T 8
| #define HAVE_LARGEFILE_SUPPORT 1
| #define SIZEOF_TIME_T 8
| #define WITH_DECIMAL_CONTEXTVAR 1
| #define NT_THREADS 1
| #define WITH_DOC_STRINGS 1
| #define WITH_PYMALLOC 1
| #define HAVE_DYNAMIC_LOADING 1
| #define HAVE_CLOCK 1
| #define HAVE_EXECV 1
| #define HAVE_FTIME 1
| #define HAVE_GETLOGIN 1
| #define HAVE_GETPEERNAME 1
| #define HAVE_GETPID 1
| #define HAVE_MBRTOWC 1
| /* end confdefs.h.  */
| /* Define mktime to an innocuous variant, in case <limits.h> declares mktime.
|    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
| #define mktime innocuous_mktime
| 
| /* System header to define __stub macros and hopefully few prototypes,
|    which can conflict with char mktime (); below.  */
| 
| #include <limits.h>
| #undef mktime
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char mktime ();
| /* The GNU C library defines this for functions which it implements
|     to always fail with ENOSYS.  Some functions are actually named
|     something starting with __ and the normal name is an alias.  */
| #if defined __stub_mktime || defined __stub___mktime
| choke me
| #endif
| 
| int
| main (void)
| {
| return mktime ();
|   ;
|   return 0;
| }
configure:13740: result: no

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to