https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909

--- Comment #17 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #16)
> Are those weak refs from libstdc++.a objects or from the user *.o files?

>From libstdc++.a

> If the former, perhaps we could declare some libstdc++ APIs (related to
> threading) as requiring linking of -lpthread and made them non-weak in
> libstdc++.a.

Yes, I think we should just use the non-weak pthread_xxx symbols directly when
!defined(_GLIBCXX_SHARED) and rely on those sections from libstdc++.a not being
used unless they're needed.

> I don't really see how can one reproduce this on Fedora/RHEL/CentOS where
> libpthread.a
> contains a single libpthread.o and therefore it is either you link no thread
> support at all, or link it completely.

The example in comment 0 fails on Fedora. Nothing in libstdc++.a causes
anything from libpthread.o to be used.

Reply via email to