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

Luís Marques via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Sep 17 02:40:31 PDT 2020


luismarques added a comment.

I think this makes sense, but I'll let the #libc <https://reviews.llvm.org/tag/libc/> reviewers actually review/approve this.



================
Comment at: libcxx/src/atomic.cpp:20
+#if !defined(__NR_futex) && defined(__riscv) && __riscv_xlen == 32
+#define __NR_futex __NR_futex_time64
+#endif
----------------
raj.khem wrote:
> 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
I suggest adding a comment here describing this situation.


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

https://reviews.llvm.org/D85095



More information about the libcxx-commits mailing list