Handle NetBSD symbol renaming in sanitizer_common_interceptors.inc

Summary:
NetBSD renames symbols for historical and compat reasons.

Add required symbol renames in sanitizer_common_interceptors.inc:

 - clock_gettime -> __clock_gettime50
 - clock_getres -> __clock_getres50
 - clock_settime -> __clock_settime50
 - setitimer -> __setitimer50
 - getitimer -> __getitimer50
 - opendir -> __opendir30
 - readdir -> __readdir30
 - time -> __time50
 - localtime_r -> __localtime_r50
 - gmtime_r -> __gmtime_r50
 - gmtime -> __gmtime50
 - ctime -> __ctime50
 - ctime_r -> __ctime_r50
 - mktime -> __mktime50
 - getpwnam -> __getpwnam50
 - getpwuid -> __getpwuid50
 - getpwnam_r -> __getpwnam_r50
 - getpwuid_r -> __getpwuid_r50
 - getpwent -> __getpwent50
 - glob -> __glob30
 - wait3 -> __wait350
 - wait4 -> __wait450
 - readdir_r -> __readdir_r30
 - setlocale -> __setlocale50
 - scandir -> __scandir30
 - sigtimedwait -> __sigtimedwait50
 - sigemptyset -> __sigemptyset14
 - sigfillset -> __sigfillset14
 - sigpending -> __sigpending14
 - sigprocmask -> __sigprocmask14
 - shmctl -> __shmctl50
 - times -> __times13
 - stat -> __stat50
 - getutent -> __getutent50
 - getutxent -> __getutxent50
 - getutxid -> __getutxid50
 - getutxline -> __getutxline50

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka, cryptoad, dvyukov

Reviewed By: cryptoad

Subscribers: llvm-commits, kubamracek, #sanitizers

Tags: #sanitizers

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

llvm-svn: 319670
This commit is contained in:
Kamil Rytarowski 2017-12-04 18:24:15 +00:00
parent 83df523330
commit 8e0eca0e48
1 changed files with 40 additions and 0 deletions

View File

@ -69,6 +69,46 @@
#define iconv __bsd_iconv
#endif
#if SANITIZER_NETBSD
#define clock_getres __clock_getres50
#define clock_gettime __clock_gettime50
#define clock_settime __clock_settime50
#define ctime __ctime50
#define ctime_r __ctime_r50
#define getitimer __getitimer50
#define getpwent __getpwent50
#define getpwnam __getpwnam50
#define getpwnam_r __getpwnam_r50
#define getpwuid __getpwuid50
#define getpwuid_r __getpwuid_r50
#define getutent __getutent50
#define getutxent __getutxent50
#define getutxid __getutxid50
#define getutxline __getutxline50
#define glob __glob30
#define gmtime __gmtime50
#define gmtime_r __gmtime_r50
#define localtime_r __localtime_r50
#define mktime __mktime50
#define opendir __opendir30
#define readdir __readdir30
#define readdir_r __readdir_r30
#define scandir __scandir30
#define setitimer __setitimer50
#define setlocale __setlocale50
#define shmctl __shmctl50
#define sigemptyset __sigemptyset14
#define sigfillset __sigfillset14
#define sigpending __sigpending14
#define sigprocmask __sigprocmask14
#define sigtimedwait __sigtimedwait50
#define stat __stat50
#define time __time50
#define times __times13
#define wait3 __wait350
#define wait4 __wait450
#endif
// Platform-specific options.
#if SANITIZER_MAC
namespace __sanitizer {