package/vim: fix build with uclibc
PATCH 1/1 package/vim: fix build with uclibc
Fix the following build failure with uclibc raised since bump to version 8.2.3565 in commit 5650439b922d020cfad1131e5fb536bce73eb845 and
https://github.com/vim/vim/commit/0a7984af5601323fae7b3398f05a48087db7b767:
In file included from vim.h:27,
from fileio.c:14:
fileio.c: In function 'time_differs':
auto/config.h:149:22: error: 'stat_T' {aka 'struct stat'} has no member named 'st_mtim'; did you mean 'st_mtime'?
149 | #define ST_MTIM_NSEC st_mtim.tv_nsec
| ^~~~~~~Fixes:
- http://autobuild.buildroot.org/results/2132f9aa1b0bc618c91f7bf44fbd1b71b9d6ba05
--- ...for-nanosecond-resolution-timestamps.patch | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 package/vim/0001-Fix-config-of-old-systems-for-nanosecond-resolution-timestamps.patch
package/vim/0001-Fix-config-of-old-systems-for-nanosecond-resolution-timestamps.patch new file +56 -0
@@ -0,0 +1,56 @@ +From b5db1ebf06d2904522ebf246f9c6a8bbf8fca398 Mon Sep 17 00:00:00 2001 +From: Gary Johnson <[email protected]> +Date: Tue, 26 Oct 2021 13:50:19 -0700 +Subject: [PATCH] Fix config of old systems for nanosecond-resolution + timestamps + +On old systems (e.g. 32-bit systems running Ubuntu 10.4), defining +_XOPEN_SOURCE causes _BSD_SOURCE and _SVID_SOURCE not to be defined, +which causes nanosecond-resolution timestamps not to be included in +struct stat, which causes the build of fileio.c to fail. + +_XOPEN_SOURCE is defined for some systems in vim.h. + +A solution is to define _BSD_SOURCE and _SVID_SOURCE whenever +_XOPEN_SOURCE is defined. + +On new systems, defining either _BSD_SOURCE or _SVID_SOURCE causes +/usr/include/features.h to issue a warning message about _BSD_SOURCE and +_SVID_SOURCE being deprecated and to use _DEFAULT_SOURCE instead. + +A solution for that is to also define _DEFAULT_SOURCE when _BSD_SOURCE +and _SVID_SOURCE are defined. + +[Retrieved from: +https://github.com/vim/vim/pull/9054/commits/b5db1ebf06d2904522ebf246f9c6a8bbf8fca398] +Signed-off-by: Fabrice Fontaine <[email protected]> +--- + src/vim.h | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/src/vim.h b/src/vim.h +index 31d4bdefe87..f62ad88c7a1 100644 +--- a/src/vim.h ++++ b/src/vim.h +@@ -43,6 +43,21 @@ + // 700 is needed for mkdtemp(). + # ifndef _XOPEN_SOURCE + # define _XOPEN_SOURCE 700 ++ ++// On old systems, defining _XOPEN_SOURCE causes _BSD_SOURCE and/or ++// _SVID_SOURCE not to be defined, so do that here. Those are needed to ++// include nanosecond-resolution timestamps in struct stat. On new systems, ++// _DEFAULT_SOURCE is needed to avoid warning messages about using deprecated ++// _BSD_SOURCE or _SVID_SOURCE. ++# ifndef _BSD_SOURCE ++# define _BSD_SOURCE 1 ++# endif ++# ifndef _SVID_SOURCE ++# define _SVID_SOURCE 1 ++# endif ++# ifndef _DEFAULT_SOURCE ++# define _DEFAULT_SOURCE 1 ++# endif + # endif + # endif +
Signature · 6 lines
2.33.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 13 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Fabrice" == Fabrice Fontaine <[email protected]> writes:
Fix the following build failure with uclibc raised since bump to version 8.2.3565 in commit
5650439b922d020cfad1131e5fb536bce73eb845and
https://github.com/vim/vim/commit/0a7984af5601323fae7b3398f05a48087db7b767:In file included from vim.h:27,
from fileio.c:14: fileio.c: In function 'time_differs': auto/config.h:149:22: error: 'stat_T' {aka 'struct stat'} has no member named 'st_mtim'; did you mean 'st_mtime'? 149 | #define ST_MTIM_NSEC st_mtim.tv_nsec | ^~~~~~~
Quoted 4 lines
Fixes:
- http://autobuild.buildroot.org/results/2132f9aa1b0bc618c91f7bf44fbd1b71b9d6ba05Signed-off-by Fabrice Fontaine <[email protected]>
Committed, thanks.
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 13 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Fabrice" == Fabrice Fontaine <[email protected]> writes:
Fix the following build failure with uclibc raised since bump to version 8.2.3565 in commit
5650439b922d020cfad1131e5fb536bce73eb845and
https://github.com/vim/vim/commit/0a7984af5601323fae7b3398f05a48087db7b767:In file included from vim.h:27,
from fileio.c:14: fileio.c: In function 'time_differs': auto/config.h:149:22: error: 'stat_T' {aka 'struct stat'} has no member named 'st_mtim'; did you mean 'st_mtime'? 149 | #define ST_MTIM_NSEC st_mtim.tv_nsec | ^~~~~~~
Quoted 4 lines
Fixes:
- http://autobuild.buildroot.org/results/2132f9aa1b0bc618c91f7bf44fbd1b71b9d6ba05Signed-off-by Fabrice Fontaine <[email protected]>
Committed to 2021.02.x and 2021.08.x, thanks.
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot