[PATCH] D21478: [build] Make sure to link main executable with libpthread

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 17 13:36:26 PDT 2016

tra added a comment.

In http://reviews.llvm.org/D21478#461228, @rafael wrote:

> Is that a documented restriction?

I couldn't find it stated explicitly anywhere.  "add -pthread (no 'l' after dash) and magic will happen" is pretty much it.

On the other hand, it sort of makes sense. 
libpthread overrides number of weak symbols in standard c library and we do want *all* symbols in our executable either use all those symbols from standard library or use all of them from libpthread. With shared liking (and lazy library loading and symbol binding?) we may end up with some symbols getting resolved from libc which is already loaded and available and others from libpthread when it gets loaded by some other shared library.

> We should have a comment saying why we need to do this.



More information about the llvm-commits mailing list