Support the setjmp(3) family of functions in TSan/NetBSD
authorKamil Rytarowski <n54@gmx.com>
Tue, 28 Nov 2017 17:35:35 +0000 (17:35 +0000)
committerKamil Rytarowski <n54@gmx.com>
Tue, 28 Nov 2017 17:35:35 +0000 (17:35 +0000)
commit4e9e9bf0cfd674a7dbbb4438fc148be6308ce957
tree812a93570da932a19ee428b21f87f408bc0d425a
parent353f7cbc21eacbf857ef76310998e8cac54d19f3
Support the setjmp(3) family of functions in TSan/NetBSD

Summary:
This change adds support for the setjmp(3)/longjmp(3)
family of functions on NetBSD.

There are three types of them on NetBSD:

 - setjmp(3) / longjmp(3)
 - sigsetjmp(3) / sigsetjmp(3)
 - _setjmp(3) / _longjmp(3)

Due to historical and compat reasons the symbol
names are mangled:

 - setjmp -> __setjmp14
 - longjmp -> __longjmp14
 - sigsetjmp -> __sigsetjmp14
 - siglongjmp -> __siglongjmp14
 - _setjmp -> _setjmp
 - _longjmp -> _longjmp

This leads to symbol renaming in the existing codebase.

There is no such symbol as __sigsetjmp/__longsetjmp
on NetBSD

Add a comment that GNU-style executable stack
note is not needed on NetBSD. The stack is not
executable without it.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, dvyukov, vitalybuka

Reviewed By: dvyukov

Subscribers: llvm-commits, kubamracek, #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D40337

llvm-svn: 319189
compiler-rt/lib/tsan/rtl/tsan_interceptors.cc
compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S