[Openmp-commits] [PATCH] D59451: Fix gettid warnings and one test on FreeBSD

Jonas Hahnfeld via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sun Mar 17 04:36:03 PDT 2019

Hahnfeld added a comment.

In D59451#1432251 <https://reviews.llvm.org/D59451#1432251>, @dim wrote:

> In D59451#1432201 <https://reviews.llvm.org/D59451#1432201>, @protze.joachim wrote:
> > This code does not directly use pthreads, but uses C++11 threads.
> >  Why does the compiler not link the necessary threading library, when using C++11 threads?
> How would the compiler know up-front what is in the code?  I have not often seen compilers that influence linking flags from the code that was compiled, unless maybe the Microsoft specific `#pragma lib` feature (which somebody is now adding to clang, I believe).  Usually, these kinds of flags are specified by the user, and passed from the frontend to the linker.

The point is that the test case is using `std::thread` and the compiler needs to link all libraries that are needed for the stdlib to work. If this includes `libpthread` that's up to the compiler, so I agree with Joachim that adding linking flags does not seem right.

  rOMP OpenMP



More information about the Openmp-commits mailing list