I found cause of the problem.
The problem is that on this system, an i686 running Ubuntu 10.04.4,
vim's stat_T is configured to not include "struct timespec st_mtim",
but that struct is required by patch 8.2.3510, so the build fails.
On this system, stat_T is "struct stat", which is defined in
/usr/include/bits/stat.h. That struct includes "struct timespec
st_mtime" only if __USE_MISC is defined. __USE_MISC is defined in
/usr/include/features.h if either _BSD_SOURCE or _SVID_SOURCE is
defined. Those two macros are defined by default by other rules in
/usr/include/features.h which is why Vim's configure script decides
that "struct stat" contains "struct timespec st_mtime" and sets
ST_MTIM_NSEC accordingly.
The cause of the problem is here in Vim's vim.h:
39 # if (defined(__linux__) && !defined(__ANDROID__)) || defined(__CYGWIN__)
40 // Needed for strptime(). Needs to be done early, since header files can
41 // include other header files and end up including time.h, where these symbols
42 // matter for Vim.
43 // 700 is needed for mkdtemp().
44 # ifndef _XOPEN_SOURCE
45 # define _XOPEN_SOURCE 700
46 # endif
47 # endif
Because /usr/include/features.h sees that _XOPEN_SOURCE is defined,
it defines neither _BSD_SOURCE nor _SVID_SOURCE and consequently
doesn't define __USE_MISC, so "struct stat" does not contain "struct
timespec st_mtime" and the build of fileio.c fails.
On my Ubuntu 20.04.3 x86_64 system, Vim builds fine because stat_T
is "struct stat64", defined in
/usr/include/x86_64-linux-gnu/bits/stat.h, and includes "struct
timespec st_mtime" only if __USE_XOPEN2K8 is defined, which it is
when vim is built as well as when configure is run.
I don't understand all the ins and outs of defining various
_*_SOURCE macros, but this problem could be fixed by having vim.h
define _BSD_SOURCE and _SVID_SOURCE when it defines _XOPEN_SOURCE,
e.g., by changing the above snippet to:
39 # if (defined(__linux__) && !defined(__ANDROID__)) || defined(__CYGWIN__)
40 // Needed for strptime(). Needs to be done early, since header files can
41 // include other header files and end up including time.h, where these symbols
42 // matter for Vim.
43 // 700 is needed for mkdtemp().
44 # ifndef _XOPEN_SOURCE
45 # define _XOPEN_SOURCE 700
46 # define _BSD_SOURCE 1
47 # define _SVID_SOURCE 1
47 # define _DEFAULT_SOURCE 1
48 # endif
47 # endif
The define of _DEFAULT_SOURCE is needed to avoid warnings from the
compiler that _BSD_SOURCE and _SVID_SOURCE are now deprecated.
I realize that only one of _BSD_SOURCE and _SVID_SOURCE need to be
defined, but I didn't see a reason to choose one over the other, so
I defined both.
Regards,
Gary