[Bug libstdc++/58909] C++11's condition variables fail with static linking

2021-07-22 Thread glisse at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 Marc Glisse changed: What|Removed |Added CC||glisse at gcc dot gnu.org --- Comment #27

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2021-07-22 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 --- Comment #26 from Jonathan Wakely --- If you create a new thread of execution then you'll get a non-weak reference to pthread_create, which should cause libpthread.so to be linked even with -Wl,--as-needed (and for static linking it will work

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2021-07-22 Thread glisse at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 --- Comment #25 from Marc Glisse --- Note that this also affects dynamic linking with -Wl,--as-needed (which some platforms use by default). #include int main(){ std::once_flag o; std::call_once(o, [](){}); } $ g++ b.cc -lpthread && ldd

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2021-04-19 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 Jonathan Wakely changed: What|Removed |Added Assignee|redi at gcc dot gnu.org|unassigned at gcc dot gnu.org

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2021-01-28 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 Jonathan Wakely changed: What|Removed |Added Last reconfirmed||2021-01-28

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2021-01-28 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 --- Comment #24 from Jakub Jelinek --- Actually asm (".global pthread_cond_init"); (etc.) is probably better, doesn't need relocations, just adds the symbol to the symtab as non-weak.

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2021-01-28 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 --- Comment #23 from Jakub Jelinek --- Unaware of extern directive in gas. I'd think (but it would need to be surrounded by configury checks) that something like: .section .gnu.need.pthread_cond, "e" .8byte pthread_cond_init ... .previous where

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2021-01-28 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 --- Comment #22 from Jonathan Wakely --- In that case it finds the no-op symbol in libc.so.6 and doesn't crash. $ g++ cv.C -g -Wl,--trace-symbol=pthread_cond_destroy /usr/bin/ld: /lib64/libc.so.6: definition of pthread_cond_destroy This

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2021-01-28 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 --- Comment #21 from Jakub Jelinek --- So how does that work for dynamic linking when -lpthread is not linked in? Does it crash too?

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2021-01-28 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 --- Comment #20 from Jonathan Wakely --- I don't think so. The linker just doesn't resolve the undefined weak symbol for pthread_cond_destroy is left equal to zero, and so there's a segfault when it gets called. $ g++ cv.C -static -g

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2021-01-28 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 --- Comment #19 from Jakub Jelinek --- Is that because some functions are also in libc.a and not just in libpthread.a?

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2021-01-28 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 --- Comment #18 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #17) > (In reply to Jakub Jelinek from comment #16) > The example in comment 0 fails on Fedora. Nothing in libstdc++.a causes > anything from libpthread.o to be

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2021-01-28 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 --- Comment #17 from Jonathan Wakely --- (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

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2021-01-28 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 --- Comment #16 from Jakub Jelinek --- Are those weak refs from libstdc++.a objects or from the user *.o files? If the former, perhaps we could declare some libstdc++ APIs (related to threading) as requiring linking of -lpthread and made them

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2021-01-28 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 --- Comment #15 from Jonathan Wakely --- And the static libc++.a doesn't use weak symbols, so you need to link to libpthread youself, and the necessary symbols get pulled in correctly. The problem for libstdc++.a is that the weak symbols do not

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2021-01-28 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 --- Comment #14 from Jonathan Wakely --- (In reply to Jakub Jelinek from comment #13) > Maybe libc++ doesn't bother with supporting not linking against -lpthread. libc++ is linked to libpthread.so unconditionally.

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2021-01-28 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 --- Comment #13 from Jakub Jelinek --- Maybe libc++ doesn't bother with supporting not linking against -lpthread.

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2021-01-28 Thread ksaunders at nowsecure dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 Keegan Saunders changed: What|Removed |Added CC||ksaunders at nowsecure dot com ---

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2020-12-02 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 Jonathan Wakely changed: What|Removed |Added CC||g.bonacci at libero dot it ---

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2017-03-03 Thread abbytsing at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 abbycin changed: What|Removed |Added CC||abbytsing at hotmail dot com --- Comment #10

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2017-02-15 Thread joel at clambassador dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 joel at clambassador dot com changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2017-02-14 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 --- Comment #8 from Jonathan Wakely --- Well Roland's fix doesn't work, and his claims about libstdc++ problems are based on ancient history, so I don't find his arguments very persuasive. I'm happy to document the requirements in the libstdc++

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2017-02-14 Thread brooks at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 --- Comment #7 from Brooks Moses --- Right, understood, but Roland seemed pretty insistent in the discussion on bug 57740 that this was a libstdc++ bug, not a glibc bug. Your contention is that this is invalid because he's wrong about that, I

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2017-02-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 --- Comment #6 from Jakub Jelinek --- INVALID means it is not a gcc bug, glibc has a separate bugzilla.

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2017-02-13 Thread brooks at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 Brooks Moses changed: What|Removed |Added CC||brooks at gcc dot gnu.org --- Comment #5

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2016-08-14 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 Andrew Pinski changed: What|Removed |Added CC||roland at gnu dot org --- Comment #4

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2016-08-13 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2015-05-08 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 Jonathan Wakely redi at gcc dot gnu.org changed: What|Removed |Added CC||tomas.ukkonen

[Bug libstdc++/58909] C++11's condition variables fail with static linking

2013-10-29 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 Jakub Jelinek jakub at gcc dot gnu.org changed: What|Removed |Added CC||jakub at gcc dot