summaryrefslogtreecommitdiff
path: root/include/features.h
diff options
context:
space:
mode:
authorNadav Tasher <tashernadav@gmail.com>2024-12-22 22:11:57 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2025-01-02 09:23:10 +0100
commitaf63ee93ed565c3c8228e5e1eeb48f750c86d750 (patch)
treecf76ec51344094734b77407f706e2a2706e1cc3f /include/features.h
parentf8028afeaffd727bc335681491b25a6f8fe51f4d (diff)
features.h: error out when attempting to compile with TIME64 for 32bit targets on Linux versions prior to 5.1.0
Using 64bit time on 32bit targets was only introduced in Linux 5.1.0. On versions prior to that, compiling uClibc-ng produces incorrect headers that cause the `clock_nanosleep` syscall to receive incorrect arguments. Signed-off-by: Nadav Tasher <tashernadav@gmail.com>
Diffstat (limited to 'include/features.h')
-rw-r--r--include/features.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/features.h b/include/features.h
index 1a4efb9db..0b09d71a2 100644
--- a/include/features.h
+++ b/include/features.h
@@ -449,6 +449,12 @@
# include <libc-internal.h>
#endif
+#include <linux/version.h>
+
+#if defined(__UCLIBC_USE_TIME64__) && __TARGET_ARCH_BITS__ == 32 && LINUX_VERSION_CODE < KERNEL_VERSION(5,1,0)
+#error 64bit time on 32bit targets is not supported on Linux < 5.1.0
+#endif
+
#if defined(__UCLIBC_USE_TIME64__) || __TARGET_ARCH_BITS__ == 64
#define __USE_TIME_BITS64 1
#endif