On 11.09.2020 23:38, Joerg Sonnenberger wrote: > On Fri, Sep 11, 2020 at 04:07:24PM +0200, Kamil Rytarowski wrote: >> The current code is confusing, as it attempts to use unimplemented >> _PTHREAD_GETTCB_EXT() and in one place uses _lwp_getprivate_fast() in >> other _lwp_getprivate(). This caused my confusion... as I assumed that >> _lwp_getprivate_fast() is internal and _lwp_getprivate() for public >> consumption. > > _PTHREAD_GETTCB_EXT is a rump hack. There is no _lwp_getprivate_fast. > There is __lwp_getprivate_fast, which originally wasn't implemented on > architectures without a fast path (like VAX). Nowadays, all functional > ports provide either __lwp_getprivate_fast (potentially with a fall-back > to the system call) or __lwp_gettcb_fast. The difference is whether the > TLS register is biased or not. > Do you agree with this patch: http://netbsd.org/~kamil/patch-00278-_rtld_tls_self.txt And then, using _rtld_tls_self() in sanitizers (and wherever someone finds it useful)? As an alternative we will use __lwp_gettcb_fast() or __lwp_getprivate_fast() manually in 3rd party code, which seems fragile. > Joerg >
Attachment:
signature.asc
Description: OpenPGP digital signature