This is an archive of the discontinued LLVM Phabricator instance.

Implement GetTls() for NetBSD
ClosedPublic

Authored by krytarowski on Nov 15 2017, 3:34 PM.

Details

Summary

Reuse the existing code for FreeBSD that is compatible with NetBSD.

Add NetBSD support in tests: tls_race.cc and tls_race2.cc.

Sponsored by <The NetBSD Foundation>

Diff Detail

Repository
rL LLVM

Event Timeline

krytarowski created this revision.Nov 15 2017, 3:34 PM

Verification from @joerg is welcome.

dvyukov accepted this revision.Nov 15 2017, 11:41 PM
This revision is now accepted and ready to land.Nov 15 2017, 11:41 PM

This patch also helps MSan/NetBSD.. and perhaps is the reason why MSan started to work better - modulo this DEADLYSIGNAL that plagues sanitizers on NetBSD.

http://www.netbsd.org/~kamil/llvm/msan.txt

krytarowski closed this revision.Nov 16 2017, 9:54 AM
joerg added inline comments.Nov 16 2017, 2:24 PM
lib/sanitizer_common/sanitizer_linux_libcdep.cc
319

Please follow ld.elf_so/tls.c here and use _lwp_setprivate/_lwp_settcb for consistent behavior across all platforms.

355

It would be better to use struct tls_tcb from sys/tls.h here, avoids having to distinguish variant I and variant II.

krytarowski added inline comments.Nov 16 2017, 5:40 PM
lib/sanitizer_common/sanitizer_linux_libcdep.cc
319
355