[libcxx-commits] [libcxx] 85b9c5c - [libc++] Fix libcxx build on 32bit architectures with 64bit time_t defaults e.g. riscv32

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 4 08:39:23 PST 2021


Author: Louis Dionne
Date: 2021-02-04T11:38:54-05:00
New Revision: 85b9c5ccc172a1e61c7ecaaec4752587cb6f1e26

URL: https://github.com/llvm/llvm-project/commit/85b9c5ccc172a1e61c7ecaaec4752587cb6f1e26
DIFF: https://github.com/llvm/llvm-project/commit/85b9c5ccc172a1e61c7ecaaec4752587cb6f1e26.diff

LOG: [libc++] Fix libcxx build on 32bit architectures with 64bit time_t defaults e.g. riscv32

Patch by Khem Raj.

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

Added: 
    

Modified: 
    libcxx/src/atomic.cpp

Removed: 
    


################################################################################
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


        


More information about the libcxx-commits mailing list