[libcxx-commits] [PATCH] D96062: [🍒][libc++] Fix libcxx build on 32bit architectures with 64bit time_t defaults e.g. riscv32

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 4 10:35:36 PST 2021

ldionne created this revision.
ldionne added a reviewer: tstellar.
Herald added subscribers: vkmr, evandro, sameer.abuasal, s.egerton, Jim, benna, psnobl, rogfer01, jkorous, shiva0217, kito-cheng, simoncook.
ldionne requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Patch by Khem Raj.

(cherry pick of commit 85b9c5ccc172a1e61c7ecaaec4752587cb6f1e26 <https://reviews.llvm.org/rG85b9c5ccc172a1e61c7ecaaec4752587cb6f1e26>)

  rG LLVM Github Monorepo



Index: libcxx/src/atomic.cpp
--- libcxx/src/atomic.cpp
+++ 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
 #else // <- Add other operating systems here
 // Baseline needs no new headers

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96062.321509.patch
Type: text/x-patch
Size: 556 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210204/3a4f1ecd/attachment.bin>

More information about the libcxx-commits mailing list