[llvm-branch-commits] [libcxx] 251f329 - [🍒][libc++] Fix libcxx build on 32bit architectures with 64bit time_t defaults e.g. riscv32

Louis Dionne via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Feb 8 10:49:48 PST 2021


Author: Louis Dionne
Date: 2021-02-08T13:49:02-05:00
New Revision: 251f3295b498b699aa2b926167a788a6b6dbc033

URL: https://github.com/llvm/llvm-project/commit/251f3295b498b699aa2b926167a788a6b6dbc033
DIFF: https://github.com/llvm/llvm-project/commit/251f3295b498b699aa2b926167a788a6b6dbc033.diff

LOG: [🍒][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

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 llvm-branch-commits mailing list