[PATCH] D21478: [build] Link main executable with libpthread

David Abdurachmanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 29 02:04:39 PDT 2018


davidlt added a comment.
Herald added subscribers: jlebar, mgorny, sanjoy.

The following caused error while building LLVM on riscv64 system. I think, you must use -pthread and never use -lpthread. A few points:

- -pthread also modified CPP flags and defines _REENTRANT, which is required by standard;
- Based on above -pthread also needs to be in your CPP/CXX FLAGS;
- On riscv64 -pthread also implies libatomic (might change in the future).

TL;DR -pthread needs to be used and needs to be passed to compile and link flags.


Repository:
  rL LLVM

https://reviews.llvm.org/D21478





More information about the llvm-commits mailing list