libc/stdlib: Add __cxa_thread_atexit_impl() hook.
authorzrj <rimvydas.jasinskas@gmail.com>
Mon, 1 Apr 2019 17:16:47 +0000 (20:16 +0300)
committerzrj <zrj@dragonflybsd.org>
Sun, 7 Apr 2019 19:15:03 +0000 (22:15 +0300)
commit284b4eb248dfa77ebf719d095f347fcaabc7f437
treeb5cd3681667a964533476a5a1f8daa253690b30e
parente0bdab235e8bbbb39d51aeb82c1044c68efa3ba7
libc/stdlib: Add __cxa_thread_atexit_impl() hook.

The __cxa_thread_atexit_impl() helper is needed for mainly c++ runtime
libraries to support destructors for thread local storage using LIFO.
The _thread_finalize() is implemented based on OpenBSD variant with few
exceptions: less restrictive destructors calling scheme and c++ runtime
preserves implementation details how it orders (or even uses) this libc
addition. Based on other BSDs and libsdc++/libc++ code this is least
intrusive method to have pthread_exit() hooks in libc runtime. By the
looks, in base system nothing was using libstdc++ internal version.

While there, enable __cxa_thread_atexit_impl() usage in gcc80 libstdc++.
gnu/lib/gcc80/libstdcxx/headers/config.h
lib/libc/gen/Symbol.map
lib/libc/include/libc_private.h
lib/libc/stdlib/Makefile.inc
lib/libc/stdlib/Symbol.map
lib/libc/stdlib/cxa_thread_atexit_impl.c [new file with mode: 0644]
lib/libc/stdlib/exit.c
lib/libc_r/uthread/uthread_exit.c
lib/libthread_xu/thread/thr_exit.c