[PATCH] D56836: [mips] Include whole lpthread when using both -pthread and -static

Simon Atanasyan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 17 03:34:50 PST 2019


atanasyan added a comment.

Now I'm not sure that we really need to make this code more complicated. As to the `stdthreadbug` test case, maybe we can just exclude this test if LDFLAGS contains the `-static` option.

As to this patch, is it possible to implement the following algorithm? Will it be more easy and clear?

1. if there is no `-pthread` or `-pthreads` flag, do nothing.
2. if the flag provided, iterate over `-l` options (do not introduce new `lpthread` first-class argument). If there is the `-lpthread` (with or without `whole-archive` surrounds), consider a user know what he/she wants to do.
3. if there is no `-lpthread`, pass `--whole-archive -lpthread --no-whole-archive` to the linker.


Repository:
  rC Clang

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

https://reviews.llvm.org/D56836





More information about the cfe-commits mailing list