[libcxx-commits] [PATCH] D94909: [VE] Define FUTEX values
Kazushi Marukawa via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Dec 3 21:56:50 PST 2021
kaz7 updated this revision to Diff 391810.
kaz7 added a comment.
Rebase to the latest main. VE is now an official target of llvm.
I would like to support libcxx for VE also.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94909/new/
https://reviews.llvm.org/D94909
Files:
libcxx/src/atomic.cpp
Index: libcxx/src/atomic.cpp
===================================================================
--- libcxx/src/atomic.cpp
+++ libcxx/src/atomic.cpp
@@ -16,7 +16,18 @@
#ifdef __linux__
#include <unistd.h>
+#if defined(__ve__)
+// VE doesn't have linux/futex.h. But, VEOS implements some FUTEX system calls.
+// These system calls are good enough for libcxx. Therefore, we define FUTEX
+// flags here locally to compile libcxx using FUTEX system calls.
+# define FUTEX_WAIT 0
+# define FUTEX_WAKE 1
+# define FUTEX_PRIVATE_FLAG 128
+# define FUTEX_WAIT_PRIVATE (FUTEX_WAIT | FUTEX_PRIVATE_FLAG)
+# define FUTEX_WAKE_PRIVATE (FUTEX_WAKE | FUTEX_PRIVATE_FLAG)
+#else
#include <linux/futex.h>
+#endif
#include <sys/syscall.h>
// libc++ uses SYS_futex as a universal syscall name. However, on 32 bit architectures
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94909.391810.patch
Type: text/x-patch
Size: 841 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211204/3bc01454/attachment.bin>
More information about the libcxx-commits
mailing list