[libcxx-commits] [PATCH] D85095: Fix libcxx build on riscv32

Khem Raj via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 3 10:28:08 PDT 2020


raj.khem added inline comments.


================
Comment at: libcxx/src/atomic.cpp:20
+#if !defined(__NR_futex) && defined(__riscv) && __riscv_xlen == 32
+#define __NR_futex __NR_futex_time64
+#endif
----------------
ldionne wrote:
> I'm not sure I understand -- libc++ doesn't use `__NR_futex` anywhere. Can you explain how this fix works?
libc++ does use SYS_futex, which it expects from system C library, in glibc (/usr/include/bits/syscall.h defines it in terms of of __NR_futex)  rv32 is using 64bit time_t from get go unlike other 32bit architectures in glibc, therefore it wont have __NR_futex defined but just __NR_futex_time64, this aliases it to __NR_futex so that SYS_futex is then defined for rv32


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85095/new/

https://reviews.llvm.org/D85095



More information about the libcxx-commits mailing list