瀏覽代碼

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>
Nadav Tasher 10 月之前
父節點
當前提交
af63ee93ed
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      include/features.h

+ 6 - 0
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