summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Dionne <ldionne.2@gmail.com>2021-02-03 17:00:20 -0500
committerLouis Dionne <ldionne.2@gmail.com>2021-02-08 13:49:02 -0500
commit251f3295b498b699aa2b926167a788a6b6dbc033 (patch)
tree2d8e08cf962eafc4111fd936539427bf6542df26
parentbc39d53d9a4f1ed7c903648f3fd408296fd55c95 (diff)
downloadllvm-251f3295b498b699aa2b926167a788a6b6dbc033.tar.gz
[🍒][libc++] Fix libcxx build on 32bit architectures with 64bit time_t defaults e.g. riscv32
Patch by Khem Raj. (cherry pick of commit 85b9c5ccc172a1e61c7ecaaec4752587cb6f1e26) Differential Revision: https://reviews.llvm.org/D96062
-rw-r--r--libcxx/src/atomic.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libcxx/src/atomic.cpp b/libcxx/src/atomic.cpp
index 6b73ed771cd1..9ae1fb5199bf 100644
--- a/libcxx/src/atomic.cpp
+++ b/libcxx/src/atomic.cpp
@@ -19,6 +19,12 @@
#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