summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_netbsd.cc
Commit message (Collapse)AuthorAgeFilesLines
* compiler-rt: Rename .cc file in lib/sanitizer_common to .cppNico Weber2019-07-311-338/+0
| | | | | | | | | | | See https://reviews.llvm.org/D58620 for discussion, and for the commands I ran. In addition I also ran for f in $(svn diff | diffstat | grep .cc | cut -f 2 -d ' '); do rg $f . ; done and manually updated (many) references to renamed files found by that. llvm-svn: 367463
* Add NetBSD LSan supportKamil Rytarowski2019-07-111-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Combine few relatively small changes into one: - implement internal_ptrace() and internal_clone() for NetBSD - add support for stoptheworld based on the ptrace(2) API - define COMPILER_RT_HAS_LSAN for NetBSD - enable tests for NetBSD/amd64 Inspired by the original implementation by Christos Zoulas in netbsd/src for GCC. The implementation is in theory CPU independent through well defined macros across all NetBSD ports, however only the x86_64 version was tested. Reviewers: mgorny, dvyukov, vitalybuka, joerg, jfb Reviewed By: vitalybuka Subscribers: dexonsmith, jfb, srhines, kubamracek, llvm-commits, christos Tags: #llvm Differential Revision: https://reviews.llvm.org/D64057 llvm-svn: 365735
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [sanitizer] Support running without fd 0,1,2.Evgeniy Stepanov2018-12-201-0/+5
| | | | | | | | | | | | | | | | | | | Summary: Support running with no open file descriptors (as may happen to "init" process on linux). * Remove a check that writing to stderr succeeds. * When opening a file (ex. for log_path option), dup the new fd out of [0, 2] range to avoid confusing the program. (2nd attempt, this time without the sanitizer_rtems change) Reviewers: pcc, vitalybuka Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D55801 llvm-svn: 349817
* Revert "[sanitizer] Support running without fd 0,1,2."Ilya Biryukov2018-12-201-5/+0
| | | | | | | | This reverts commit r349699. Reason: the commit breaks compilation of sanitizer_rtems.cc when building for RTEMS. llvm-svn: 349745
* [sanitizer] Support running without fd 0,1,2.Evgeniy Stepanov2018-12-191-0/+5
| | | | | | | | | | | | | | | | | Summary: Support running with no open file descriptors (as may happen to "init" process on linux). * Remove a check that writing to stderr succeeds. * When opening a file (ex. for log_path option), dup the new fd out of [0, 2] range to avoid confusing the program. Reviewers: pcc, vitalybuka Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D55801 llvm-svn: 349699
* Fix internal_sleep() for NetBSDKamil Rytarowski2018-12-151-1/+1
| | | | | | This is a follow up of a similar fix for Linux from D55692. llvm-svn: 349257
* Unwind local macro DEFINE_INTERNAL()Kamil Rytarowski2018-10-051-47/+43
| | | | | | | | No functional change intended. This is a follow up of a suggestion from D52793. llvm-svn: 343870
* Introduce internal_sysctlbyname in place of sysctlbynameKamil Rytarowski2018-10-051-0/+8
| | | | | | | | | | | | | | | | | | Summary: This change will allow to install sysctlbyname() interceptors more easily in sanitizers. Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D52793 llvm-svn: 343840
* Switch syscall(2)/__syscall(2) calls to libc calls on NetBSDKamil Rytarowski2018-10-011-0/+326
Summary: When possible, switch syscall(2)/__syscall(2) calls to direct calls of internal libc symbols. Add a new function to detect address of a libc symbol of a function that could be intercepted. With the address detector in GetRealLibcAddress(), an optional interceptor of libc call will be bypassed. The original approach with syscall(2)/__syscall(2) wasn't portable across supported ABIs and CPU architectures. The indirect syscall interface is also a candidate for removal in future revisions of NetBSD, as the C language ABI is not a good domain for serialization of arbitrary functions arguments. Switch the following functions to libc calls: - internal_mmap() - internal_munmap() - internal_mprotect() - internal_close() - internal_open() - internal_read() - internal_write() - internal_ftruncate() - internal_stat() - internal_lstat() - internal_fstat() - internal_dup2() - internal_readlink() - internal_unlink() - internal_rename() - internal_sched_yield() - internal__exit() - internal_sleep() - internal_execve() - NanoTime() - internal_clock_gettime() - internal_waitpid() - internal_getpid() - internal_getppid() - internal_getdents() - internal_lseek() - internal_sigaltstack() - internal_fork() - internal_sigprocmask() - internal_sysctl() - internal_sigemptyset() - internal_sigfillset() - GetTid() - TgKill() This revision leaves room for refactoring in subsequent commits. Reviewers: vitalybuka, kcc, joerg Reviewed By: vitalybuka Subscribers: mgorny, fedor.sergeev, jfb, loverszhaokai, devnexen, kubamracek, llvm-commits, ro, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D51419 llvm-svn: 343523
OpenPOWER on IntegriCloud