[libc++] Fix libcxx build on 32bit architectures with 64bit time_t defaults e.g....
authorLouis Dionne <ldionne.2@gmail.com>
Wed, 3 Feb 2021 22:00:20 +0000 (17:00 -0500)
committerLouis Dionne <ldionne.2@gmail.com>
Thu, 4 Feb 2021 16:38:54 +0000 (11:38 -0500)
Patch by Khem Raj.

Differential Revision: https://reviews.llvm.org/D85095

libcxx/src/atomic.cpp

index 6b73ed7..9ae1fb5 100644 (file)
 #include <linux/futex.h>
 #include <sys/syscall.h>
 
+// libc++ uses SYS_futex as a universal syscall name. However, on 32 bit architectures
+// with a 64 bit time_t, we need to specify SYS_futex_time64.
+#if !defined(SYS_futex) && defined(SYS_futex_time64)
+# define SYS_futex SYS_futex_time64
+#endif
+
 #else // <- Add other operating systems here
 
 // Baseline needs no new headers