pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
compiler-rt-netbsd: Start splitting posix and netbsd code
Module Name: pkgsrc-wip
Committed By: Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By: kamil
Date: Sun Aug 27 08:01:07 2017 +0200
Changeset: 49ad0c2184561c92523094c87b0cd43fce95925d
Modified Files:
compiler-rt-netbsd/distinfo
compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__posix.h
Added Files:
compiler-rt-netbsd/patches/patch-lib_sanitizer__common_CMakeLists.txt
compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc
compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h
Removed Files:
compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__posix.cc
Log Message:
compiler-rt-netbsd: Start splitting posix and netbsd code
On demand from upstream split NetBSD from sanitizer_platform_limits_posix.h.
Part 1.
Sponsored by <The NetBSD Foundation>
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=49ad0c2184561c92523094c87b0cd43fce95925d
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
compiler-rt-netbsd/distinfo | 6 +-
.../patch-lib_sanitizer__common_CMakeLists.txt | 12 +
...__common_sanitizer__platform__limits__netbsd.cc | 428 +++++++++++++++
...r__common_sanitizer__platform__limits__netbsd.h | 571 ++++++++++++++++++++
...r__common_sanitizer__platform__limits__posix.cc | 253 ---------
...er__common_sanitizer__platform__limits__posix.h | 589 +--------------------
6 files changed, 1021 insertions(+), 838 deletions(-)
diffs:
diff --git a/compiler-rt-netbsd/distinfo b/compiler-rt-netbsd/distinfo
index 453eed7333..97e4d1a99d 100644
--- a/compiler-rt-netbsd/distinfo
+++ b/compiler-rt-netbsd/distinfo
@@ -20,8 +20,10 @@ SHA1 (patch-lib_fuzzer_FuzzerExtraCounters.cpp) = 52fefa927397acd7e83df06df7ec13
SHA1 (patch-lib_fuzzer_FuzzerUtilLinux.cpp) = 30e0ead2deb98ac0a7f67403c47044ef6ec16185
SHA1 (patch-lib_fuzzer_afl_afl__driver.cpp) = a114e28152558b7147d0931eb638109c3d2f32a2
SHA1 (patch-lib_fuzzer_tests_CMakeLists.txt) = eaffd9f8f2621ad465b5c734a764bdff0243af3d
-SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__posix.cc) = 36a89517584891a1a50536a681a5d42e99ef904d
-SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__posix.h) = 89302e7b40901faaa471cdd76eefa222a0cc055d
+SHA1 (patch-lib_sanitizer__common_CMakeLists.txt) = 41b67281e9c9498c0be923f8aca05e93ef92db35
+SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc) = 04812bc64ed53e6e1da764b70678d85252c28d5a
+SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h) = 89ce6c77523b479fda2a52ba65e1513dc048f6db
+SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__posix.h) = 86d872c585bfde552276a5f3e3d198338663bafd
SHA1 (patch-lib_tsan_go_buildgo.sh) = fe64b3389bbf6ae2ddf187df3e0600b2f817f51d
SHA1 (patch-lib_tsan_rtl_tsan__interceptors.cc) = 557018c2dce673756215ebf9f1564866df555444
SHA1 (patch-lib_tsan_rtl_tsan__platform__linux.cc) = 4269acd5ea1d1f448fb9a7a31def2f84a03b27da
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_CMakeLists.txt b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_CMakeLists.txt
new file mode 100644
index 0000000000..f5441d119b
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_CMakeLists.txt
@@ -0,0 +1,12 @@
+$NetBSD$
+
+--- lib/sanitizer_common/CMakeLists.txt.orig 2017-08-03 21:24:37.000000000 +0000
++++ lib/sanitizer_common/CMakeLists.txt
+@@ -118,6 +118,7 @@ set(SANITIZER_HEADERS
+ sanitizer_placement_new.h
+ sanitizer_platform.h
+ sanitizer_platform_interceptors.h
++ sanitizer_platform_limits_netbsd.h
+ sanitizer_platform_limits_posix.h
+ sanitizer_posix.h
+ sanitizer_procmaps.h
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc
new file mode 100644
index 0000000000..f928d1444f
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc
@@ -0,0 +1,428 @@
+$NetBSD$
+
+--- lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc.orig 2017-08-27 05:17:29.575199440 +0000
++++ lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc
+@@ -0,0 +1,423 @@
++//===-- sanitizer_platform_limits_posix.cc --------------------------------===//
++//
++// The LLVM Compiler Infrastructure
++//
++// This file is distributed under the University of Illinois Open Source
++// License. See LICENSE.TXT for details.
++//
++//===----------------------------------------------------------------------===//
++//
++// This file is a part of Sanitizer common code.
++//
++// Sizes and layouts of platform-specific NetBSD data structures.
++//===----------------------------------------------------------------------===//
++
++#include "sanitizer_platform.h"
++
++#if SANITIZER_NETBSD
++#include <arpa/inet.h>
++#include <dirent.h>
++#include <grp.h>
++#include <limits.h>
++#include <net/if.h>
++#include <netdb.h>
++#include <poll.h>
++#include <pthread.h>
++#include <pwd.h>
++#include <signal.h>
++#include <stddef.h>
++#include <sys/mman.h>
++#include <sys/resource.h>
++#include <sys/socket.h>
++#include <sys/stat.h>
++#include <sys/time.h>
++#include <sys/times.h>
++#include <sys/types.h>
++#include <sys/utsname.h>
++#include <termios.h>
++#include <time.h>
++#include <wchar.h>
++#include <utmp.h>
++#include <net/route.h>
++#include <sys/mount.h>
++#include <sys/timeb.h>
++#include <utmpx.h>
++# include <sys/mount.h>
++# include <sys/sockio.h>
++# include <sys/socket.h>
++# include <sys/filio.h>
++# include <sys/signal.h>
++# include <sys/timespec.h>
++# include <sys/timex.h>
++# include <sys/mqueue.h>
++# include <sys/msg.h>
++# include <sys/ipc.h>
++# include <sys/msg.h>
++# include <sys/statvfs.h>
++# include <sys/soundcard.h>
++# include <sys/mtio.h>
++# include <netinet/ip_mroute.h>
++# include <netinet/in.h>
++# include <net/ppp_defs.h>
++# include <glob.h>
++# include <term.h>
++#include <link_elf.h>
++#include <net/if_ether.h>
++#include <sys/shm.h>
++#define statfs statvfs
++#define d_ino d_fileno
++
++#undef IOC_DIRMASK
++
++# include <utime.h>
++# include <sys/ptrace.h>
++# include <semaphore.h>
++#include <ifaddrs.h>
++#include <sys/ucontext.h>
++#include <wordexp.h>
++
++// Include these after system headers to avoid name clashes and ambiguities.
++#include "sanitizer_internal_defs.h"
++#include "sanitizer_platform_limits_posix.h"
++
++namespace __sanitizer {
++ unsigned struct_utsname_sz = sizeof(struct utsname);
++ unsigned struct_stat_sz = sizeof(struct stat);
++ unsigned struct_rusage_sz = sizeof(struct rusage);
++ unsigned struct_tm_sz = sizeof(struct tm);
++ unsigned struct_passwd_sz = sizeof(struct passwd);
++ unsigned struct_group_sz = sizeof(struct group);
++ unsigned siginfo_t_sz = sizeof(siginfo_t);
++ unsigned struct_sigaction_sz = sizeof(struct sigaction);
++ unsigned struct_itimerval_sz = sizeof(struct itimerval);
++ unsigned pthread_t_sz = sizeof(pthread_t);
++ unsigned pthread_cond_t_sz = sizeof(pthread_cond_t);
++ unsigned pid_t_sz = sizeof(pid_t);
++ unsigned timeval_sz = sizeof(timeval);
++ unsigned uid_t_sz = sizeof(uid_t);
++ unsigned gid_t_sz = sizeof(gid_t);
++ unsigned mbstate_t_sz = sizeof(mbstate_t);
++ unsigned sigset_t_sz = sizeof(sigset_t);
++ unsigned struct_timezone_sz = sizeof(struct timezone);
++ unsigned struct_tms_sz = sizeof(struct tms);
++ unsigned struct_sigevent_sz = sizeof(struct sigevent);
++ unsigned struct_sched_param_sz = sizeof(struct sched_param);
++ unsigned struct_statfs_sz = sizeof(struct statfs);
++ unsigned struct_sockaddr_sz = sizeof(struct sockaddr);
++ unsigned ucontext_t_sz = sizeof(ucontext_t);
++ unsigned struct_rlimit_sz = sizeof(struct rlimit);
++ unsigned struct_timespec_sz = sizeof(struct timespec);
++ unsigned struct_utimbuf_sz = sizeof(struct utimbuf);
++ unsigned struct_itimerspec_sz = sizeof(struct itimerspec);
++ unsigned struct_timex_sz = sizeof(struct timex);
++ unsigned struct_msqid_ds_sz = sizeof(struct msqid_ds);
++ unsigned struct_mq_attr_sz = sizeof(struct mq_attr);
++ unsigned struct_statvfs_sz = sizeof(struct statvfs);
++
++ uptr sig_ign = (uptr)SIG_IGN;
++ uptr sig_dfl = (uptr)SIG_DFL;
++ uptr sa_siginfo = (uptr)SA_SIGINFO;
++
++ unsigned struct_shminfo_sz = sizeof(struct shminfo);
++#define IPC_INFO -1
++#define SHM_INFO -1
++#define SHM_STAT -1
++ unsigned struct_shm_info_sz = -1;
++#endif
++ int shmctl_ipc_stat = (int)IPC_STAT;
++ int shmctl_ipc_info = (int)IPC_INFO;
++ int shmctl_shm_info = (int)SHM_INFO;
++
++#endif
++
++ unsigned struct_utmp_sz = sizeof(struct utmp);
++ unsigned struct_utmpx_sz = sizeof(struct utmpx);
++
++ int map_fixed = MAP_FIXED;
++
++ int af_inet = (int)AF_INET;
++ int af_inet6 = (int)AF_INET6;
++
++ uptr __sanitizer_in_addr_sz(int af) {
++ if (af == AF_INET)
++ return sizeof(struct in_addr);
++ else if (af == AF_INET6)
++ return sizeof(struct in6_addr);
++ else
++ return 0;
++ }
++
++int glob_nomatch = GLOB_NOMATCH;
++int glob_altdirfunc = GLOB_ALTDIRFUNC;
++
++ unsigned path_max = PATH_MAX;
++
++ // ioctl arguments
++ unsigned struct_ifreq_sz = sizeof(struct ifreq);
++ unsigned struct_termios_sz = sizeof(struct termios);
++ unsigned struct_winsize_sz = sizeof(struct winsize);
++ unsigned struct_midi_info_sz = sizeof(struct midi_info);
++ unsigned struct_mtget_sz = sizeof(struct mtget);
++ unsigned struct_mtop_sz = sizeof(struct mtop);
++ unsigned struct_sbi_instrument_sz = sizeof(struct sbi_instrument);
++ unsigned struct_seq_event_rec_sz = sizeof(struct seq_event_rec);
++ unsigned struct_synth_info_sz = sizeof(struct synth_info);
++ unsigned struct_vt_mode_sz = sizeof(struct vt_mode);
++ unsigned struct_audio_buf_info_sz = sizeof(struct audio_buf_info);
++ unsigned struct_ppp_stats_sz = sizeof(struct ppp_stats);
++ unsigned struct_sioc_sg_req_sz = sizeof(struct sioc_sg_req);
++ unsigned struct_sioc_vif_req_sz = sizeof(struct sioc_vif_req);
++
++ const unsigned IOCTL_NOT_PRESENT = 0;
++
++ unsigned IOCTL_FIOASYNC = FIOASYNC;
++ unsigned IOCTL_FIOCLEX = FIOCLEX;
++ unsigned IOCTL_FIOGETOWN = FIOGETOWN;
++ unsigned IOCTL_FIONBIO = FIONBIO;
++ unsigned IOCTL_FIONCLEX = FIONCLEX;
++ unsigned IOCTL_FIOSETOWN = FIOSETOWN;
++ unsigned IOCTL_SIOCADDMULTI = SIOCADDMULTI;
++ unsigned IOCTL_SIOCATMARK = SIOCATMARK;
++ unsigned IOCTL_SIOCDELMULTI = SIOCDELMULTI;
++ unsigned IOCTL_SIOCGIFADDR = SIOCGIFADDR;
++ unsigned IOCTL_SIOCGIFBRDADDR = SIOCGIFBRDADDR;
++ unsigned IOCTL_SIOCGIFCONF = SIOCGIFCONF;
++ unsigned IOCTL_SIOCGIFDSTADDR = SIOCGIFDSTADDR;
++ unsigned IOCTL_SIOCGIFFLAGS = SIOCGIFFLAGS;
++ unsigned IOCTL_SIOCGIFMETRIC = SIOCGIFMETRIC;
++ unsigned IOCTL_SIOCGIFMTU = SIOCGIFMTU;
++ unsigned IOCTL_SIOCGIFNETMASK = SIOCGIFNETMASK;
++ unsigned IOCTL_SIOCGPGRP = SIOCGPGRP;
++ unsigned IOCTL_SIOCSIFADDR = SIOCSIFADDR;
++ unsigned IOCTL_SIOCSIFBRDADDR = SIOCSIFBRDADDR;
++ unsigned IOCTL_SIOCSIFDSTADDR = SIOCSIFDSTADDR;
++ unsigned IOCTL_SIOCSIFFLAGS = SIOCSIFFLAGS;
++ unsigned IOCTL_SIOCSIFMETRIC = SIOCSIFMETRIC;
++ unsigned IOCTL_SIOCSIFMTU = SIOCSIFMTU;
++ unsigned IOCTL_SIOCSIFNETMASK = SIOCSIFNETMASK;
++ unsigned IOCTL_SIOCSPGRP = SIOCSPGRP;
++ unsigned IOCTL_TIOCCONS = TIOCCONS;
++ unsigned IOCTL_TIOCEXCL = TIOCEXCL;
++ unsigned IOCTL_TIOCGETD = TIOCGETD;
++ unsigned IOCTL_TIOCGPGRP = TIOCGPGRP;
++ unsigned IOCTL_TIOCGWINSZ = TIOCGWINSZ;
++ unsigned IOCTL_TIOCMBIC = TIOCMBIC;
++ unsigned IOCTL_TIOCMBIS = TIOCMBIS;
++ unsigned IOCTL_TIOCMGET = TIOCMGET;
++ unsigned IOCTL_TIOCMSET = TIOCMSET;
++ unsigned IOCTL_TIOCNOTTY = TIOCNOTTY;
++ unsigned IOCTL_TIOCNXCL = TIOCNXCL;
++ unsigned IOCTL_TIOCOUTQ = TIOCOUTQ;
++ unsigned IOCTL_TIOCPKT = TIOCPKT;
++ unsigned IOCTL_TIOCSCTTY = TIOCSCTTY;
++ unsigned IOCTL_TIOCSETD = TIOCSETD;
++ unsigned IOCTL_TIOCSPGRP = TIOCSPGRP;
++ unsigned IOCTL_TIOCSTI = TIOCSTI;
++ unsigned IOCTL_TIOCSWINSZ = TIOCSWINSZ;
++ unsigned IOCTL_SIOCGETSGCNT = SIOCGETSGCNT;
++ unsigned IOCTL_SIOCGETVIFCNT = SIOCGETVIFCNT;
++ unsigned IOCTL_TCFLSH = TCFLSH;
++ unsigned IOCTL_TCGETA = TCGETA;
++ unsigned IOCTL_TCGETS = TCGETS;
++ unsigned IOCTL_TCSBRK = TCSBRK;
++ unsigned IOCTL_TCSBRKP = TCSBRKP;
++ unsigned IOCTL_TCSETA = TCSETA;
++ unsigned IOCTL_TCSETAF = TCSETAF;
++ unsigned IOCTL_TCSETAW = TCSETAW;
++ unsigned IOCTL_TCSETS = TCSETS;
++ unsigned IOCTL_TCSETSF = TCSETSF;
++ unsigned IOCTL_TCSETSW = TCSETSW;
++ unsigned IOCTL_TCXONC = TCXONC;
++ unsigned IOCTL_TIOCGLCKTRMIOS = TIOCGLCKTRMIOS;
++ unsigned IOCTL_TIOCGSOFTCAR = TIOCGSOFTCAR;
++ unsigned IOCTL_TIOCINQ = TIOCINQ;
++ unsigned IOCTL_TIOCLINUX = TIOCLINUX;
++ unsigned IOCTL_TIOCSERCONFIG = TIOCSERCONFIG;
++ unsigned IOCTL_TIOCSERGETLSR = TIOCSERGETLSR;
++ unsigned IOCTL_TIOCSERGWILD = TIOCSERGWILD;
++ unsigned IOCTL_TIOCSERSWILD = TIOCSERSWILD;
++ unsigned IOCTL_TIOCSLCKTRMIOS = TIOCSLCKTRMIOS;
++ unsigned IOCTL_TIOCSSOFTCAR = TIOCSSOFTCAR;
++ unsigned IOCTL_VT_DISALLOCATE = VT_DISALLOCATE;
++ unsigned IOCTL_VT_GETSTATE = VT_GETSTATE;
++ unsigned IOCTL_VT_RESIZE = VT_RESIZE;
++ unsigned IOCTL_VT_RESIZEX = VT_RESIZEX;
++ unsigned IOCTL_VT_SENDSIG = VT_SENDSIG;
++#endif // SANITIZER_LINUX
++
++ const int si_SEGV_MAPERR = SEGV_MAPERR;
++ const int si_SEGV_ACCERR = SEGV_ACCERR;
++} // namespace __sanitizer
++
++using namespace __sanitizer;
++
++COMPILER_CHECK(sizeof(__sanitizer_pthread_attr_t) >= sizeof(pthread_attr_t));
++
++COMPILER_CHECK(sizeof(socklen_t) == sizeof(unsigned));
++CHECK_TYPE_SIZE(pthread_key_t);
++
++// There are more undocumented fields in dl_phdr_info that we are not interested
++// in.
++COMPILER_CHECK(sizeof(__sanitizer_dl_phdr_info) <= sizeof(dl_phdr_info));
++CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_addr);
++CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_name);
++CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phdr);
++CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phnum);
++
++CHECK_TYPE_SIZE(glob_t);
++CHECK_SIZE_AND_OFFSET(glob_t, gl_pathc);
++CHECK_SIZE_AND_OFFSET(glob_t, gl_pathv);
++CHECK_SIZE_AND_OFFSET(glob_t, gl_offs);
++CHECK_SIZE_AND_OFFSET(glob_t, gl_flags);
++CHECK_SIZE_AND_OFFSET(glob_t, gl_closedir);
++CHECK_SIZE_AND_OFFSET(glob_t, gl_readdir);
++CHECK_SIZE_AND_OFFSET(glob_t, gl_opendir);
++CHECK_SIZE_AND_OFFSET(glob_t, gl_lstat);
++CHECK_SIZE_AND_OFFSET(glob_t, gl_stat);
++
++CHECK_TYPE_SIZE(addrinfo);
++CHECK_SIZE_AND_OFFSET(addrinfo, ai_flags);
++CHECK_SIZE_AND_OFFSET(addrinfo, ai_family);
++CHECK_SIZE_AND_OFFSET(addrinfo, ai_socktype);
++CHECK_SIZE_AND_OFFSET(addrinfo, ai_protocol);
++CHECK_SIZE_AND_OFFSET(addrinfo, ai_protocol);
++CHECK_SIZE_AND_OFFSET(addrinfo, ai_addrlen);
++CHECK_SIZE_AND_OFFSET(addrinfo, ai_canonname);
++CHECK_SIZE_AND_OFFSET(addrinfo, ai_addr);
++
++CHECK_TYPE_SIZE(hostent);
++CHECK_SIZE_AND_OFFSET(hostent, h_name);
++CHECK_SIZE_AND_OFFSET(hostent, h_aliases);
++CHECK_SIZE_AND_OFFSET(hostent, h_addrtype);
++CHECK_SIZE_AND_OFFSET(hostent, h_length);
++CHECK_SIZE_AND_OFFSET(hostent, h_addr_list);
++
++CHECK_TYPE_SIZE(iovec);
++CHECK_SIZE_AND_OFFSET(iovec, iov_base);
++CHECK_SIZE_AND_OFFSET(iovec, iov_len);
++
++CHECK_TYPE_SIZE(msghdr);
++CHECK_SIZE_AND_OFFSET(msghdr, msg_name);
++CHECK_SIZE_AND_OFFSET(msghdr, msg_namelen);
++CHECK_SIZE_AND_OFFSET(msghdr, msg_iov);
++CHECK_SIZE_AND_OFFSET(msghdr, msg_iovlen);
++CHECK_SIZE_AND_OFFSET(msghdr, msg_control);
++CHECK_SIZE_AND_OFFSET(msghdr, msg_controllen);
++CHECK_SIZE_AND_OFFSET(msghdr, msg_flags);
++
++CHECK_TYPE_SIZE(cmsghdr);
++CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_len);
++CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_level);
++CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_type);
++
++COMPILER_CHECK(sizeof(__sanitizer_dirent) <= sizeof(dirent));
++CHECK_SIZE_AND_OFFSET(dirent, d_ino);
++// There is no 'd_off' field on FreeBSD.
++CHECK_SIZE_AND_OFFSET(dirent, d_reclen);
++
++CHECK_TYPE_SIZE(ifconf);
++CHECK_SIZE_AND_OFFSET(ifconf, ifc_len);
++CHECK_SIZE_AND_OFFSET(ifconf, ifc_ifcu);
++
++CHECK_TYPE_SIZE(pollfd);
++CHECK_SIZE_AND_OFFSET(pollfd, fd);
++CHECK_SIZE_AND_OFFSET(pollfd, events);
++CHECK_SIZE_AND_OFFSET(pollfd, revents);
++
++CHECK_TYPE_SIZE(nfds_t);
++
++CHECK_TYPE_SIZE(sigset_t);
++
++COMPILER_CHECK(sizeof(__sanitizer_sigaction) == sizeof(struct sigaction));
++// Can't write checks for sa_handler and sa_sigaction due to them being
++// preprocessor macros.
++CHECK_STRUCT_SIZE_AND_OFFSET(sigaction, sa_mask);
++
++CHECK_TYPE_SIZE(wordexp_t);
++CHECK_SIZE_AND_OFFSET(wordexp_t, we_wordc);
++CHECK_SIZE_AND_OFFSET(wordexp_t, we_wordv);
++CHECK_SIZE_AND_OFFSET(wordexp_t, we_offs);
++
++CHECK_TYPE_SIZE(tm);
++CHECK_SIZE_AND_OFFSET(tm, tm_sec);
++CHECK_SIZE_AND_OFFSET(tm, tm_min);
++CHECK_SIZE_AND_OFFSET(tm, tm_hour);
++CHECK_SIZE_AND_OFFSET(tm, tm_mday);
++CHECK_SIZE_AND_OFFSET(tm, tm_mon);
++CHECK_SIZE_AND_OFFSET(tm, tm_year);
++CHECK_SIZE_AND_OFFSET(tm, tm_wday);
++CHECK_SIZE_AND_OFFSET(tm, tm_yday);
++CHECK_SIZE_AND_OFFSET(tm, tm_isdst);
++CHECK_SIZE_AND_OFFSET(tm, tm_gmtoff);
++CHECK_SIZE_AND_OFFSET(tm, tm_zone);
++
++CHECK_TYPE_SIZE(ether_addr);
++
++CHECK_TYPE_SIZE(ipc_perm);
++CHECK_SIZE_AND_OFFSET(ipc_perm, _key);
++CHECK_SIZE_AND_OFFSET(ipc_perm, _seq);
++CHECK_SIZE_AND_OFFSET(ipc_perm, uid);
++CHECK_SIZE_AND_OFFSET(ipc_perm, gid);
++CHECK_SIZE_AND_OFFSET(ipc_perm, cuid);
++CHECK_SIZE_AND_OFFSET(ipc_perm, cgid);
++CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
++
++CHECK_TYPE_SIZE(shmid_ds);
++CHECK_SIZE_AND_OFFSET(shmid_ds, shm_perm);
++CHECK_SIZE_AND_OFFSET(shmid_ds, shm_segsz);
++CHECK_SIZE_AND_OFFSET(shmid_ds, shm_atime);
++CHECK_SIZE_AND_OFFSET(shmid_ds, shm_dtime);
++CHECK_SIZE_AND_OFFSET(shmid_ds, shm_ctime);
++CHECK_SIZE_AND_OFFSET(shmid_ds, shm_cpid);
++CHECK_SIZE_AND_OFFSET(shmid_ds, shm_lpid);
++CHECK_SIZE_AND_OFFSET(shmid_ds, shm_nattch);
++
++CHECK_TYPE_SIZE(clock_t);
++
++CHECK_TYPE_SIZE(ifaddrs);
++CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_next);
++CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_name);
++CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_addr);
++CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_netmask);
++// Compare against the union, because we can't reach into the union in a
++// compliant way.
++#ifdef ifa_dstaddr
++#undef ifa_dstaddr
++#endif
++CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_dstaddr);
++CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_data);
++
++CHECK_TYPE_SIZE(timeb);
++CHECK_SIZE_AND_OFFSET(timeb, time);
++CHECK_SIZE_AND_OFFSET(timeb, millitm);
++CHECK_SIZE_AND_OFFSET(timeb, timezone);
++CHECK_SIZE_AND_OFFSET(timeb, dstflag);
++
++CHECK_TYPE_SIZE(passwd);
++CHECK_SIZE_AND_OFFSET(passwd, pw_name);
++CHECK_SIZE_AND_OFFSET(passwd, pw_passwd);
++CHECK_SIZE_AND_OFFSET(passwd, pw_uid);
++CHECK_SIZE_AND_OFFSET(passwd, pw_gid);
++CHECK_SIZE_AND_OFFSET(passwd, pw_dir);
++CHECK_SIZE_AND_OFFSET(passwd, pw_shell);
++
++CHECK_SIZE_AND_OFFSET(passwd, pw_gecos);
++
++CHECK_TYPE_SIZE(group);
++CHECK_SIZE_AND_OFFSET(group, gr_name);
++CHECK_SIZE_AND_OFFSET(group, gr_passwd);
++CHECK_SIZE_AND_OFFSET(group, gr_gid);
++CHECK_SIZE_AND_OFFSET(group, gr_mem);
++
++CHECK_TYPE_SIZE(XDR);
++CHECK_SIZE_AND_OFFSET(XDR, x_op);
++CHECK_SIZE_AND_OFFSET(XDR, x_ops);
++CHECK_SIZE_AND_OFFSET(XDR, x_public);
++CHECK_SIZE_AND_OFFSET(XDR, x_private);
++CHECK_SIZE_AND_OFFSET(XDR, x_base);
++CHECK_SIZE_AND_OFFSET(XDR, x_handy);
++COMPILER_CHECK(__sanitizer_XDR_ENCODE == XDR_ENCODE);
++COMPILER_CHECK(__sanitizer_XDR_DECODE == XDR_DECODE);
++COMPILER_CHECK(__sanitizer_XDR_FREE == XDR_FREE);
++
++#endif // SANITIZER_NETBSD
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h
new file mode 100644
index 0000000000..0201df48c8
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h
@@ -0,0 +1,571 @@
+$NetBSD$
+
+--- lib/sanitizer_common/sanitizer_platform_limits_netbsd.h.orig 2017-08-27 05:17:32.661559121 +0000
++++ lib/sanitizer_common/sanitizer_platform_limits_netbsd.h
+@@ -0,0 +1,566 @@
++//===-- sanitizer_platform_limits_posix.h ---------------------------------===//
++//
++// The LLVM Compiler Infrastructure
++//
++// This file is distributed under the University of Illinois Open Source
++// License. See LICENSE.TXT for details.
++//
++//===----------------------------------------------------------------------===//
++//
++// This file is a part of Sanitizer common code.
++//
++// Sizes and layouts of platform-specific NetBSD data structures.
++//===----------------------------------------------------------------------===//
++
++#ifndef SANITIZER_PLATFORM_LIMITS_POSIX_H
++#define SANITIZER_PLATFORM_LIMITS_POSIX_H
++
++#include "sanitizer_internal_defs.h"
++#include "sanitizer_platform.h"
++
++#define _GET_LINK_MAP_BY_DLOPEN_HANDLE(handle, shift) \
++ ((link_map *)((handle) == nullptr ? nullptr : ((char *)(handle) + (shift))))
++
++#if defined(__x86_64__)
++#define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) \
++ _GET_LINK_MAP_BY_DLOPEN_HANDLE(handle, 608)
++#elif defined(__i386__)
++#define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) \
++ _GET_LINK_MAP_BY_DLOPEN_HANDLE(handle, 324)
++#endif
++
++namespace __sanitizer {
++ extern unsigned struct_utsname_sz;
++ extern unsigned struct_stat_sz;
++ extern unsigned struct_rusage_sz;
++ extern unsigned siginfo_t_sz;
++ extern unsigned struct_itimerval_sz;
++ extern unsigned pthread_t_sz;
++ extern unsigned pthread_cond_t_sz;
++ extern unsigned pid_t_sz;
++ extern unsigned timeval_sz;
++ extern unsigned uid_t_sz;
++ extern unsigned gid_t_sz;
++ extern unsigned mbstate_t_sz;
++ extern unsigned struct_timezone_sz;
++ extern unsigned struct_tms_sz;
++ extern unsigned struct_itimerspec_sz;
++ extern unsigned struct_sigevent_sz;
++ extern unsigned struct_sched_param_sz;
++ extern unsigned struct_statfs_sz;
++ extern unsigned struct_sockaddr_sz;
++ extern unsigned ucontext_t_sz;
++
++ extern unsigned struct_rlimit_sz;
++ extern unsigned struct_utimbuf_sz;
++ extern unsigned struct_timespec_sz;
++
++ struct __sanitizer_iocb {
++ u64 aio_offset;
++ uptr aio_buf;
++ long aio_nbytes;
++ u32 aio_fildes;
++ u32 aio_lio_opcode;
++ long aio_reqprio;
++#if _LP64
++ u8 aio_sigevent[32];
++#else
++ u8 aio_sigevent[20];
++#endif
++ u32 _state;
++ u32 _errno;
++ long _retval;
++ };
++
++ struct __sanitizer___sysctl_args {
++ int *name;
++ int nlen;
++ void *oldval;
++ uptr *oldlenp;
++ void *newval;
++ uptr newlen;
++ };
++
++ struct __sanitizer_sem_t {
++ uptr data[5];
++ };
++
++ struct __sanitizer_ipc_perm {
++ u32 uid;
++ u32 gid;
++ u32 cuid;
++ u32 cgid;
++ u32 mode;
++ unsigned short _seq;
++ long _key;
++ };
++
++ struct __sanitizer_shmid_ds {
++ __sanitizer_ipc_perm shm_perm;
++ unsigned long shm_segsz;
++ u32 shm_lpid;
++ u32 shm_cpid;
++ unsigned int shm_nattch;
++ u64 shm_atime;
++ u64 shm_dtime;
++ u64 shm_ctime;
++ void *_shm_internal;
++ };
++
++ extern unsigned struct_msqid_ds_sz;
++ extern unsigned struct_mq_attr_sz;
++ extern unsigned struct_timex_sz;
++ extern unsigned struct_statvfs_sz;
++
++ struct __sanitizer_iovec {
++ void *iov_base;
++ uptr iov_len;
++ };
++
++ struct __sanitizer_ifaddrs {
++ struct __sanitizer_ifaddrs *ifa_next;
++ char *ifa_name;
++ unsigned int ifa_flags;
++ void *ifa_addr; // (struct sockaddr *)
++ void *ifa_netmask; // (struct sockaddr *)
++ void *ifa_dstaddr; // (struct sockaddr *)
++ void *ifa_data;
++ unsigned int ifa_addrflags;
++ };
++
++ typedef unsigned __sanitizer_pthread_key_t;
++
++ typedef long long __sanitizer_time_t;
++
++ struct __sanitizer_passwd {
++ char *pw_name;
++ char *pw_passwd;
++ int pw_uid;
++ int pw_gid;
++ __sanitizer_time_t pw_change;
++ char *pw_class;
++ char *pw_gecos;
++ char *pw_dir;
++ char *pw_shell;
++ __sanitizer_time_t pw_expire;
++ };
++
++ struct __sanitizer_group {
++ char *gr_name;
++ char *gr_passwd;
++ int gr_gid;
++ char **gr_mem;
++ };
++
++ struct __sanitizer_timeb {
++ __sanitizer_time_t time;
++ unsigned short millitm;
++ short timezone;
++ short dstflag;
++ };
++
++ struct __sanitizer_ether_addr {
++ u8 octet[6];
++ };
++
++ struct __sanitizer_tm {
++ int tm_sec;
++ int tm_min;
++ int tm_hour;
++ int tm_mday;
++ int tm_mon;
++ int tm_year;
++ int tm_wday;
++ int tm_yday;
++ int tm_isdst;
++ long int tm_gmtoff;
++ const char *tm_zone;
++ };
++
++ struct __sanitizer_msghdr {
++ void *msg_name;
++ unsigned msg_namelen;
++ struct __sanitizer_iovec *msg_iov;
++ unsigned msg_iovlen;
++ void *msg_control;
++ unsigned msg_controllen;
++ int msg_flags;
++ };
++ struct __sanitizer_cmsghdr {
++ unsigned cmsg_len;
++ int cmsg_level;
++ int cmsg_type;
++ };
++
++ struct __sanitizer_dirent {
++ u64 d_fileno;
++ u16 d_reclen;
++ // more fields that we don't care about
++ };
++
++ typedef int __sanitizer_clock_t;
++ typedef int __sanitizer_clockid_t;
++
++ typedef u32 __sanitizer___kernel_uid_t;
++ typedef u32 __sanitizer___kernel_gid_t;
++ typedef u64 __sanitizer___kernel_off_t;
++ typedef struct {
++ u32 fds_bits[8];
++ } __sanitizer___kernel_fd_set;
++
++ typedef struct {
++ unsigned int pta_magic;
++ int pta_flags;
++ void *pta_private;
++ } __sanitizer_pthread_attr_t;
++
++ struct __sanitizer_sigset_t {
++ // uint32_t * 4
++ unsigned int __bits[4];
++ };
++
++ struct __sanitizer_sigaction {
++ union {
++ void (*handler)(int sig);
++ void (*sigaction)(int sig, void *siginfo, void *uctx);
++ };
++ __sanitizer_sigset_t sa_mask;
++ int sa_flags;
++ };
++
++ typedef __sanitizer_sigset_t __sanitizer_kernel_sigset_t;
++
++ struct __sanitizer_kernel_sigaction_t {
++ union {
++ void (*handler)(int signo);
++ void (*sigaction)(int signo, void *info, void *ctx);
++ };
++ unsigned long sa_flags;
++ void (*sa_restorer)(void);
++ __sanitizer_kernel_sigset_t sa_mask;
++ };
++
++ extern uptr sig_ign;
++ extern uptr sig_dfl;
++ extern uptr sa_siginfo;
++
++ extern int af_inet;
++ extern int af_inet6;
++ uptr __sanitizer_in_addr_sz(int af);
++
++ struct __sanitizer_dl_phdr_info {
++ uptr dlpi_addr;
++ const char *dlpi_name;
++ const void *dlpi_phdr;
++ short dlpi_phnum;
++ };
++
++ extern unsigned struct_ElfW_Phdr_sz;
++
++ struct __sanitizer_addrinfo {
++ int ai_flags;
++ int ai_family;
++ int ai_socktype;
++ int ai_protocol;
++ unsigned ai_addrlen;
++ char *ai_canonname;
++ void *ai_addr;
++ struct __sanitizer_addrinfo *ai_next;
++ };
++
++ struct __sanitizer_hostent {
++ char *h_name;
++ char **h_aliases;
++ int h_addrtype;
++ int h_length;
++ char **h_addr_list;
++ };
++
++ struct __sanitizer_pollfd {
++ int fd;
++ short events;
++ short revents;
++ };
++
++ typedef unsigned __sanitizer_nfds_t;
++
++ struct __sanitizer_glob_t {
++ uptr gl_pathc;
++ uptr gl_matchc;
++ uptr gl_offs;
++ int gl_flags;
++ char **gl_pathv;
++ int (*gl_errfunc)(const char*, int);
++ void (*gl_closedir)(void *dirp);
++ struct dirent *(*gl_readdir)(void *dirp);
++ void *(*gl_opendir)(const char*);
++ int (*gl_lstat)(const char*, void* /* struct stat* */);
++ int (*gl_stat)(const char*, void* /* struct stat* */);
++ };
++
++ extern int glob_nomatch;
++ extern int glob_altdirfunc;
++
++ extern unsigned path_max;
++
++ struct __sanitizer_wordexp_t {
++ uptr we_wordc;
++ char **we_wordv;
++ uptr we_offs;
++ char *we_strings;
++ uptr we_nbytes;
++ };
++
++ typedef void __sanitizer_FILE;
++# define SANITIZER_HAS_STRUCT_FILE 0
++
++ extern unsigned struct_shminfo_sz;
++ extern unsigned struct_shm_info_sz;
++ extern int shmctl_ipc_stat;
++ extern int shmctl_ipc_info;
++ extern int shmctl_shm_info;
++ extern int shmctl_shm_stat;
++
++ extern unsigned struct_utmp_sz;
++ extern unsigned struct_utmpx_sz;
++
++ extern int map_fixed;
++
++ // ioctl arguments
++ struct __sanitizer_ifconf {
++ int ifc_len;
++ union {
++ void *ifcu_req;
++ } ifc_ifcu;
++ };
++
++#define IOC_NRBITS 8
++#define IOC_TYPEBITS 8
++#define IOC_SIZEBITS 14
++#define IOC_DIRBITS 2
++#define IOC_NONE 0U
++#define IOC_WRITE 1U
++#define IOC_READ 2U
++#define IOC_NRMASK ((1 << IOC_NRBITS) - 1)
++#define IOC_TYPEMASK ((1 << IOC_TYPEBITS) - 1)
++#define IOC_SIZEMASK ((1 << IOC_SIZEBITS) - 1)
++#if defined(IOC_DIRMASK)
++#undef IOC_DIRMASK
++#endif
++#define IOC_DIRMASK ((1 << IOC_DIRBITS) - 1)
++#define IOC_NRSHIFT 0
++#define IOC_TYPESHIFT (IOC_NRSHIFT + IOC_NRBITS)
++#define IOC_SIZESHIFT (IOC_TYPESHIFT + IOC_TYPEBITS)
++#define IOC_DIRSHIFT (IOC_SIZESHIFT + IOC_SIZEBITS)
++#define EVIOC_EV_MAX 0x1f
++#define EVIOC_ABS_MAX 0x3f
++
++#define IOC_DIR(nr) (((nr) >> IOC_DIRSHIFT) & IOC_DIRMASK)
++#define IOC_TYPE(nr) (((nr) >> IOC_TYPESHIFT) & IOC_TYPEMASK)
++#define IOC_NR(nr) (((nr) >> IOC_NRSHIFT) & IOC_NRMASK)
++#define IOC_SIZE(nr) (((nr) >> IOC_SIZESHIFT) & IOC_SIZEMASK)
++
++extern unsigned struct_ifreq_sz;
++extern unsigned struct_termios_sz;
++extern unsigned struct_winsize_sz;
++
++extern unsigned struct_arpreq_sz;
++
++ extern unsigned struct_mtget_sz;
++ extern unsigned struct_mtop_sz;
++ extern unsigned struct_rtentry_sz;
++ extern unsigned struct_sbi_instrument_sz;
++ extern unsigned struct_seq_event_rec_sz;
++ extern unsigned struct_synth_info_sz;
++ extern unsigned struct_vt_mode_sz;
++ extern unsigned struct_audio_buf_info_sz;
++ extern unsigned struct_ppp_stats_sz;
++ extern unsigned struct_sioc_sg_req_sz;
++ extern unsigned struct_sioc_vif_req_sz;
++
++ // ioctl request identifiers
++
++ // A special value to mark ioctls that are not present on the target platform,
++ // when it can not be determined without including any system headers.
++ extern const unsigned IOCTL_NOT_PRESENT;
++
++ extern unsigned IOCTL_FIOASYNC;
++ extern unsigned IOCTL_FIOCLEX;
++ extern unsigned IOCTL_FIOGETOWN;
++ extern unsigned IOCTL_FIONBIO;
++ extern unsigned IOCTL_FIONCLEX;
++ extern unsigned IOCTL_FIOSETOWN;
++ extern unsigned IOCTL_SIOCADDMULTI;
++ extern unsigned IOCTL_SIOCATMARK;
++ extern unsigned IOCTL_SIOCDELMULTI;
++ extern unsigned IOCTL_SIOCGIFADDR;
++ extern unsigned IOCTL_SIOCGIFBRDADDR;
++ extern unsigned IOCTL_SIOCGIFCONF;
++ extern unsigned IOCTL_SIOCGIFDSTADDR;
++ extern unsigned IOCTL_SIOCGIFFLAGS;
++ extern unsigned IOCTL_SIOCGIFMETRIC;
++ extern unsigned IOCTL_SIOCGIFMTU;
++ extern unsigned IOCTL_SIOCGIFNETMASK;
++ extern unsigned IOCTL_SIOCGPGRP;
++ extern unsigned IOCTL_SIOCSIFADDR;
++ extern unsigned IOCTL_SIOCSIFBRDADDR;
++ extern unsigned IOCTL_SIOCSIFDSTADDR;
++ extern unsigned IOCTL_SIOCSIFFLAGS;
++ extern unsigned IOCTL_SIOCSIFMETRIC;
++ extern unsigned IOCTL_SIOCSIFMTU;
++ extern unsigned IOCTL_SIOCSIFNETMASK;
++ extern unsigned IOCTL_SIOCSPGRP;
++ extern unsigned IOCTL_TIOCCONS;
++ extern unsigned IOCTL_TIOCEXCL;
++ extern unsigned IOCTL_TIOCGETD;
++ extern unsigned IOCTL_TIOCGPGRP;
++ extern unsigned IOCTL_TIOCGWINSZ;
++ extern unsigned IOCTL_TIOCMBIC;
++ extern unsigned IOCTL_TIOCMBIS;
++ extern unsigned IOCTL_TIOCMGET;
++ extern unsigned IOCTL_TIOCMSET;
++ extern unsigned IOCTL_TIOCNOTTY;
++ extern unsigned IOCTL_TIOCNXCL;
++ extern unsigned IOCTL_TIOCOUTQ;
++ extern unsigned IOCTL_TIOCPKT;
++ extern unsigned IOCTL_TIOCSCTTY;
++ extern unsigned IOCTL_TIOCSETD;
++ extern unsigned IOCTL_TIOCSPGRP;
++ extern unsigned IOCTL_TIOCSTI;
++ extern unsigned IOCTL_TIOCSWINSZ;
++ extern unsigned IOCTL_SIOCGETSGCNT;
++ extern unsigned IOCTL_SIOCGETVIFCNT;
++
++ extern unsigned IOCTL_MTIOCGET;
++ extern unsigned IOCTL_MTIOCTOP;
++ extern unsigned IOCTL_SIOCADDRT;
++ extern unsigned IOCTL_SIOCDELRT;
++ extern unsigned IOCTL_SNDCTL_DSP_GETBLKSIZE;
++ extern unsigned IOCTL_SNDCTL_DSP_GETFMTS;
++ extern unsigned IOCTL_SNDCTL_DSP_NONBLOCK;
++ extern unsigned IOCTL_SNDCTL_DSP_POST;
++ extern unsigned IOCTL_SNDCTL_DSP_RESET;
++ extern unsigned IOCTL_SNDCTL_DSP_SETFMT;
++ extern unsigned IOCTL_SNDCTL_DSP_SETFRAGMENT;
++ extern unsigned IOCTL_SNDCTL_DSP_SPEED;
++ extern unsigned IOCTL_SNDCTL_DSP_STEREO;
++ extern unsigned IOCTL_SNDCTL_DSP_SUBDIVIDE;
++ extern unsigned IOCTL_SNDCTL_DSP_SYNC;
++ extern unsigned IOCTL_SNDCTL_FM_4OP_ENABLE;
++ extern unsigned IOCTL_SNDCTL_FM_LOAD_INSTR;
++ extern unsigned IOCTL_SNDCTL_MIDI_INFO;
++ extern unsigned IOCTL_SNDCTL_MIDI_PRETIME;
++ extern unsigned IOCTL_SNDCTL_SEQ_CTRLRATE;
++ extern unsigned IOCTL_SNDCTL_SEQ_GETINCOUNT;
++ extern unsigned IOCTL_SNDCTL_SEQ_GETOUTCOUNT;
++ extern unsigned IOCTL_SNDCTL_SEQ_NRMIDIS;
++ extern unsigned IOCTL_SNDCTL_SEQ_NRSYNTHS;
++ extern unsigned IOCTL_SNDCTL_SEQ_OUTOFBAND;
++ extern unsigned IOCTL_SNDCTL_SEQ_PANIC;
++ extern unsigned IOCTL_SNDCTL_SEQ_PERCMODE;
++ extern unsigned IOCTL_SNDCTL_SEQ_RESET;
++ extern unsigned IOCTL_SNDCTL_SEQ_RESETSAMPLES;
++ extern unsigned IOCTL_SNDCTL_SEQ_SYNC;
++ extern unsigned IOCTL_SNDCTL_SEQ_TESTMIDI;
++ extern unsigned IOCTL_SNDCTL_SEQ_THRESHOLD;
++ extern unsigned IOCTL_SNDCTL_SYNTH_INFO;
++ extern unsigned IOCTL_SNDCTL_SYNTH_MEMAVL;
++ extern unsigned IOCTL_SNDCTL_TMR_CONTINUE;
++ extern unsigned IOCTL_SNDCTL_TMR_METRONOME;
++ extern unsigned IOCTL_SNDCTL_TMR_SELECT;
++ extern unsigned IOCTL_SNDCTL_TMR_SOURCE;
++ extern unsigned IOCTL_SNDCTL_TMR_START;
++ extern unsigned IOCTL_SNDCTL_TMR_STOP;
++ extern unsigned IOCTL_SNDCTL_TMR_TEMPO;
++ extern unsigned IOCTL_SNDCTL_TMR_TIMEBASE;
++ extern unsigned IOCTL_SOUND_MIXER_READ_ALTPCM;
++ extern unsigned IOCTL_SOUND_MIXER_READ_BASS;
++ extern unsigned IOCTL_SOUND_MIXER_READ_CAPS;
++ extern unsigned IOCTL_SOUND_MIXER_READ_CD;
++ extern unsigned IOCTL_SOUND_MIXER_READ_DEVMASK;
++ extern unsigned IOCTL_SOUND_MIXER_READ_ENHANCE;
++ extern unsigned IOCTL_SOUND_MIXER_READ_IGAIN;
++ extern unsigned IOCTL_SOUND_MIXER_READ_IMIX;
++ extern unsigned IOCTL_SOUND_MIXER_READ_LINE1;
++ extern unsigned IOCTL_SOUND_MIXER_READ_LINE2;
++ extern unsigned IOCTL_SOUND_MIXER_READ_LINE3;
++ extern unsigned IOCTL_SOUND_MIXER_READ_LINE;
++ extern unsigned IOCTL_SOUND_MIXER_READ_LOUD;
++ extern unsigned IOCTL_SOUND_MIXER_READ_MIC;
++ extern unsigned IOCTL_SOUND_MIXER_READ_MUTE;
++ extern unsigned IOCTL_SOUND_MIXER_READ_OGAIN;
++ extern unsigned IOCTL_SOUND_MIXER_READ_PCM;
++ extern unsigned IOCTL_SOUND_MIXER_READ_RECLEV;
++ extern unsigned IOCTL_SOUND_MIXER_READ_RECMASK;
++ extern unsigned IOCTL_SOUND_MIXER_READ_RECSRC;
++ extern unsigned IOCTL_SOUND_MIXER_READ_SPEAKER;
++ extern unsigned IOCTL_SOUND_MIXER_READ_STEREODEVS;
++ extern unsigned IOCTL_SOUND_MIXER_READ_SYNTH;
++ extern unsigned IOCTL_SOUND_MIXER_READ_TREBLE;
++ extern unsigned IOCTL_SOUND_MIXER_READ_VOLUME;
++ extern unsigned IOCTL_SOUND_MIXER_WRITE_ALTPCM;
++ extern unsigned IOCTL_SOUND_MIXER_WRITE_BASS;
++ extern unsigned IOCTL_SOUND_MIXER_WRITE_CD;
++ extern unsigned IOCTL_SOUND_MIXER_WRITE_ENHANCE;
++ extern unsigned IOCTL_SOUND_MIXER_WRITE_IGAIN;
++ extern unsigned IOCTL_SOUND_MIXER_WRITE_IMIX;
++ extern unsigned IOCTL_SOUND_MIXER_WRITE_LINE1;
++ extern unsigned IOCTL_SOUND_MIXER_WRITE_LINE2;
++ extern unsigned IOCTL_SOUND_MIXER_WRITE_LINE3;
++ extern unsigned IOCTL_SOUND_MIXER_WRITE_LINE;
++ extern unsigned IOCTL_SOUND_MIXER_WRITE_LOUD;
++ extern unsigned IOCTL_SOUND_MIXER_WRITE_MIC;
++ extern unsigned IOCTL_SOUND_MIXER_WRITE_MUTE;
++ extern unsigned IOCTL_SOUND_MIXER_WRITE_OGAIN;
++ extern unsigned IOCTL_SOUND_MIXER_WRITE_PCM;
++ extern unsigned IOCTL_SOUND_MIXER_WRITE_RECLEV;
++ extern unsigned IOCTL_SOUND_MIXER_WRITE_RECSRC;
++ extern unsigned IOCTL_SOUND_MIXER_WRITE_SPEAKER;
++ extern unsigned IOCTL_SOUND_MIXER_WRITE_SYNTH;
++ extern unsigned IOCTL_SOUND_MIXER_WRITE_TREBLE;
++ extern unsigned IOCTL_SOUND_MIXER_WRITE_VOLUME;
++ extern unsigned IOCTL_SOUND_PCM_READ_BITS;
++ extern unsigned IOCTL_SOUND_PCM_READ_CHANNELS;
++ extern unsigned IOCTL_SOUND_PCM_READ_FILTER;
++ extern unsigned IOCTL_SOUND_PCM_READ_RATE;
++ extern unsigned IOCTL_SOUND_PCM_WRITE_CHANNELS;
++ extern unsigned IOCTL_SOUND_PCM_WRITE_FILTER;
++ extern unsigned IOCTL_VT_ACTIVATE;
++ extern unsigned IOCTL_VT_GETMODE;
++ extern unsigned IOCTL_VT_OPENQRY;
++ extern unsigned IOCTL_VT_RELDISP;
++ extern unsigned IOCTL_VT_SETMODE;
++ extern unsigned IOCTL_VT_WAITACTIVE;
++
++ extern unsigned IOCTL_KDDISABIO;
++ extern unsigned IOCTL_KDENABIO;
++ extern unsigned IOCTL_KDGETLED;
++ extern unsigned IOCTL_KDGKBMODE;
++ extern unsigned IOCTL_KDGKBTYPE;
++ extern unsigned IOCTL_KDMKTONE;
++ extern unsigned IOCTL_KDSETLED;
++ extern unsigned IOCTL_KDSETMODE;
++ extern unsigned IOCTL_KDSKBMODE;
++
++ extern const int si_SEGV_MAPERR;
++ extern const int si_SEGV_ACCERR;
++} // namespace __sanitizer
++
++#define CHECK_TYPE_SIZE(TYPE) \
++ COMPILER_CHECK(sizeof(__sanitizer_##TYPE) == sizeof(TYPE))
++
++#define CHECK_SIZE_AND_OFFSET(CLASS, MEMBER) \
++ COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *) NULL)->MEMBER) == \
++ sizeof(((CLASS *) NULL)->MEMBER)); \
++ COMPILER_CHECK(offsetof(__sanitizer_##CLASS, MEMBER) == \
++ offsetof(CLASS, MEMBER))
++
++// For sigaction, which is a function and struct at the same time,
++// and thus requires explicit "struct" in sizeof() expression.
++#define CHECK_STRUCT_SIZE_AND_OFFSET(CLASS, MEMBER) \
++ COMPILER_CHECK(sizeof(((struct __sanitizer_##CLASS *) NULL)->MEMBER) == \
++ sizeof(((struct CLASS *) NULL)->MEMBER)); \
++ COMPILER_CHECK(offsetof(struct __sanitizer_##CLASS, MEMBER) == \
++ offsetof(struct CLASS, MEMBER))
++
++#endif
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__posix.cc b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__posix.cc
deleted file mode 100644
index b6fd1aad26..0000000000
--- a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__posix.cc
+++ /dev/null
@@ -1,253 +0,0 @@
-$NetBSD$
-
---- lib/sanitizer_common/sanitizer_platform_limits_posix.cc.orig 2017-07-16 22:40:10.000000000 +0000
-+++ lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-@@ -14,7 +14,7 @@
-
- #include "sanitizer_platform.h"
-
--#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_MAC
-+#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_MAC || SANITIZER_NETBSD
- // Tests in this file assume that off_t-dependent data structures match the
- // libc ABI. For example, struct dirent here is what readdir() function (as
- // exported from libc) returns, and not the user-facing "dirent", which
-@@ -78,7 +78,7 @@
- #include <net/if_arp.h>
- #endif
-
--#if SANITIZER_FREEBSD
-+#if SANITIZER_FREEBSD || SANITIZER_NETBSD
- # include <sys/mount.h>
- # include <sys/sockio.h>
- # include <sys/socket.h>
-@@ -93,16 +93,18 @@
- # include <sys/statvfs.h>
- # include <sys/soundcard.h>
- # include <sys/mtio.h>
--# include <sys/consio.h>
--# include <sys/kbio.h>
--# include <sys/link_elf.h>
- # include <netinet/ip_mroute.h>
- # include <netinet/in.h>
--# include <net/ethernet.h>
- # include <net/ppp_defs.h>
- # include <glob.h>
- # include <term.h>
-+#endif
-
-+#if SANITIZER_FREEBSD
-+#include <net/ethernet.h>
-+#include <sys/consio.h>
-+#include <sys/kbio.h>
-+#include <sys/link_elf.h>
- #define _KERNEL // to declare 'shminfo' structure
- # include <sys/shm.h>
- #undef _KERNEL
-@@ -110,11 +112,19 @@
- #undef INLINE // to avoid clashes with sanitizers' definitions
- #endif
-
--#if SANITIZER_FREEBSD || SANITIZER_IOS
-+#if SANITIZER_NETBSD
-+#include <link_elf.h>
-+#include <net/if_ether.h>
-+#include <sys/shm.h>
-+#define statfs statvfs
-+#define d_ino d_fileno
-+#endif
-+
-+#if SANITIZER_FREEBSD || SANITIZER_IOS || SANITIZER_NETBSD
- #undef IOC_DIRMASK
- #endif
-
--#if SANITIZER_LINUX || SANITIZER_FREEBSD
-+#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
- # include <utime.h>
- # include <sys/ptrace.h>
- # if defined(__mips64) || defined(__aarch64__) || defined(__arm__)
-@@ -199,9 +209,9 @@ typedef struct user_fpregs elf_fpregset_
- namespace __sanitizer {
- unsigned struct_utsname_sz = sizeof(struct utsname);
- unsigned struct_stat_sz = sizeof(struct stat);
--#if !SANITIZER_IOS && !SANITIZER_FREEBSD
-+#if !SANITIZER_IOS && !SANITIZER_FREEBSD && !SANITIZER_NETBSD
- unsigned struct_stat64_sz = sizeof(struct stat64);
--#endif // !SANITIZER_IOS && !SANITIZER_FREEBSD
-+#endif // !SANITIZER_IOS && !SANITIZER_FREEBSD && !SANITIZER_NETBSD
- unsigned struct_rusage_sz = sizeof(struct rusage);
- unsigned struct_tm_sz = sizeof(struct tm);
- unsigned struct_passwd_sz = sizeof(struct passwd);
-@@ -244,12 +254,12 @@ namespace __sanitizer {
- unsigned struct_oldold_utsname_sz = sizeof(struct oldold_utsname);
- #endif // SANITIZER_LINUX
-
--#if SANITIZER_LINUX || SANITIZER_FREEBSD
-+#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
- unsigned struct_rlimit_sz = sizeof(struct rlimit);
- unsigned struct_timespec_sz = sizeof(struct timespec);
- unsigned struct_utimbuf_sz = sizeof(struct utimbuf);
- unsigned struct_itimerspec_sz = sizeof(struct itimerspec);
--#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-+#endif // SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
-
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
- unsigned struct_ustat_sz = sizeof(struct ustat);
-@@ -257,12 +267,14 @@ namespace __sanitizer {
- unsigned struct_statvfs64_sz = sizeof(struct statvfs64);
- #endif // SANITIZER_LINUX && !SANITIZER_ANDROID
-
--#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#if (SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD) && \
-+ !SANITIZER_ANDROID
- unsigned struct_timex_sz = sizeof(struct timex);
- unsigned struct_msqid_ds_sz = sizeof(struct msqid_ds);
- unsigned struct_mq_attr_sz = sizeof(struct mq_attr);
- unsigned struct_statvfs_sz = sizeof(struct statvfs);
--#endif // (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#endif // (SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD) &&
-+ // !SANITIZER_ANDROID
-
- uptr sig_ign = (uptr)SIG_IGN;
- uptr sig_dfl = (uptr)SIG_DFL;
-@@ -272,10 +284,17 @@ namespace __sanitizer {
- int e_tabsz = (int)E_TABSZ;
- #endif
-
--
--#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#if (SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD) && \
-+ !SANITIZER_ANDROID
- unsigned struct_shminfo_sz = sizeof(struct shminfo);
-+#if !SANITIZER_NETBSD
- unsigned struct_shm_info_sz = sizeof(struct shm_info);
-+#else
-+#define IPC_INFO -1
-+#define SHM_INFO -1
-+#define SHM_STAT -1
-+ unsigned struct_shm_info_sz = -1;
-+#endif
- int shmctl_ipc_stat = (int)IPC_STAT;
- int shmctl_ipc_info = (int)IPC_INFO;
- int shmctl_shm_info = (int)SHM_INFO;
-@@ -309,9 +328,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
- unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
- #endif
-
--#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-- int glob_nomatch = GLOB_NOMATCH;
-- int glob_altdirfunc = GLOB_ALTDIRFUNC;
-+#if (SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD) && \
-+ !SANITIZER_ANDROID
-+int glob_nomatch = GLOB_NOMATCH;
-+int glob_altdirfunc = GLOB_ALTDIRFUNC;
- #endif
-
- #if SANITIZER_LINUX && !SANITIZER_ANDROID && \
-@@ -451,7 +471,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
- unsigned struct_seq_event_rec_sz = sizeof(struct seq_event_rec);
- unsigned struct_synth_info_sz = sizeof(struct synth_info);
- unsigned struct_vt_mode_sz = sizeof(struct vt_mode);
--#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-+#endif // SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
-
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
- unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct);
-@@ -478,7 +498,8 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
- unsigned struct_unimapinit_sz = sizeof(struct unimapinit);
- #endif // SANITIZER_LINUX && !SANITIZER_ANDROID
-
--#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#if (SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD) && \
-+ !SANITIZER_ANDROID
- unsigned struct_audio_buf_info_sz = sizeof(struct audio_buf_info);
- unsigned struct_ppp_stats_sz = sizeof(struct ppp_stats);
- #endif // (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-@@ -534,7 +555,8 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
- unsigned IOCTL_TIOCSPGRP = TIOCSPGRP;
- unsigned IOCTL_TIOCSTI = TIOCSTI;
- unsigned IOCTL_TIOCSWINSZ = TIOCSWINSZ;
--#if ((SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID)
-+#if ((SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD) && \
-+ !SANITIZER_ANDROID)
- unsigned IOCTL_SIOCGETSGCNT = SIOCGETSGCNT;
- unsigned IOCTL_SIOCGETVIFCNT = SIOCGETVIFCNT;
- #endif
-@@ -966,7 +988,7 @@ COMPILER_CHECK(IOC_NR(0x12345678) == _IO
- COMPILER_CHECK(IOC_TYPE(0x12345678) == _IOC_TYPE(0x12345678));
- #endif // SANITIZER_LINUX
-
--#if SANITIZER_LINUX || SANITIZER_FREEBSD
-+#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
- // There are more undocumented fields in dl_phdr_info that we are not interested
- // in.
- COMPILER_CHECK(sizeof(__sanitizer_dl_phdr_info) <= sizeof(dl_phdr_info));
-@@ -974,9 +996,10 @@ CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi
- CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_name);
- CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phdr);
- CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phnum);
--#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-+#endif // SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
-
--#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#if (SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD) && \
-+ !SANITIZER_ANDROID
- CHECK_TYPE_SIZE(glob_t);
- CHECK_SIZE_AND_OFFSET(glob_t, gl_pathc);
- CHECK_SIZE_AND_OFFSET(glob_t, gl_pathv);
-@@ -1028,7 +1051,7 @@ COMPILER_CHECK(sizeof(__sanitizer_dirent
- CHECK_SIZE_AND_OFFSET(dirent, d_ino);
- #if SANITIZER_MAC
- CHECK_SIZE_AND_OFFSET(dirent, d_seekoff);
--#elif SANITIZER_FREEBSD
-+#elif SANITIZER_FREEBSD || SANITIZER_NETBSD
- // There is no 'd_off' field on FreeBSD.
- #else
- CHECK_SIZE_AND_OFFSET(dirent, d_off);
-@@ -1125,11 +1148,15 @@ CHECK_SIZE_AND_OFFSET(mntent, mnt_passno
-
- CHECK_TYPE_SIZE(ether_addr);
-
--#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#if (SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD) && \
-+ !SANITIZER_ANDROID
- CHECK_TYPE_SIZE(ipc_perm);
- # if SANITIZER_FREEBSD
- CHECK_SIZE_AND_OFFSET(ipc_perm, key);
- CHECK_SIZE_AND_OFFSET(ipc_perm, seq);
-+#elif SANITIZER_NETBSD
-+CHECK_SIZE_AND_OFFSET(ipc_perm, _key);
-+CHECK_SIZE_AND_OFFSET(ipc_perm, _seq);
- # else
- CHECK_SIZE_AND_OFFSET(ipc_perm, __key);
- CHECK_SIZE_AND_OFFSET(ipc_perm, __seq);
-@@ -1166,20 +1193,20 @@ CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_next)
- CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_name);
- CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_addr);
- CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_netmask);
--#if SANITIZER_LINUX || SANITIZER_FREEBSD
-+#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
- // Compare against the union, because we can't reach into the union in a
- // compliant way.
- #ifdef ifa_dstaddr
- #undef ifa_dstaddr
- #endif
--# if SANITIZER_FREEBSD
-+#if SANITIZER_FREEBSD || SANITIZER_NETBSD
- CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_dstaddr);
- # else
- COMPILER_CHECK(sizeof(((__sanitizer_ifaddrs *)nullptr)->ifa_dstaddr) ==
- sizeof(((ifaddrs *)nullptr)->ifa_ifu));
- COMPILER_CHECK(offsetof(__sanitizer_ifaddrs, ifa_dstaddr) ==
- offsetof(ifaddrs, ifa_ifu));
--# endif // SANITIZER_FREEBSD
-+#endif // SANITIZER_FREEBSD || SANITIZER_NETBSD
- #else
- CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_dstaddr);
- #endif // SANITIZER_LINUX
-@@ -1280,4 +1307,5 @@ CHECK_TYPE_SIZE(sem_t);
- COMPILER_CHECK(ARM_VFPREGS_SIZE == ARM_VFPREGS_SIZE_ASAN);
- #endif
-
--#endif // SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_MAC
-+#endif // SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_MAC ||
-+ // SANITIZER_NETBSD
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__posix.h b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__posix.h
index c45d4b0d75..219d8c55f9 100644
--- a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__posix.h
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__posix.h
@@ -2,591 +2,14 @@ $NetBSD$
--- lib/sanitizer_common/sanitizer_platform_limits_posix.h.orig 2017-07-16 22:40:10.000000000 +0000
+++ lib/sanitizer_common/sanitizer_platform_limits_posix.h
-@@ -18,18 +18,32 @@
- #include "sanitizer_internal_defs.h"
- #include "sanitizer_platform.h"
-
-+#define _GET_LINK_MAP_BY_DLOPEN_HANDLE(handle, shift) \
-+ ((link_map *)((handle) == nullptr ? nullptr : ((char *)(handle) + (shift))))
-+
-+// FreeBSD's and NetBSD's dlopen() returns a pointer to an Obj_Entry structure
-+// that incorporates the map structure.
- #if SANITIZER_FREEBSD
--// FreeBSD's dlopen() returns a pointer to an Obj_Entry structure that
--// incorporates the map structure.
--# define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) \
-- ((link_map*)((handle) == nullptr ? nullptr : ((char*)(handle) + 544)))
--// Get sys/_types.h, because that tells us whether 64-bit inodes are
--// used in struct dirent below.
--#include <sys/_types.h>
-+#define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) \
-+ _GET_LINK_MAP_BY_DLOPEN_HANDLE(handle, 544)
-+#elif SANITIZER_NETBSD
-+#if defined(__x86_64__)
-+#define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) \
-+ _GET_LINK_MAP_BY_DLOPEN_HANDLE(handle, 608)
-+#elif defined(__i386__)
-+#define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) \
-+ _GET_LINK_MAP_BY_DLOPEN_HANDLE(handle, 324)
-+#endif
- #else
- # define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) ((link_map*)(handle))
- #endif // !SANITIZER_FREEBSD
-
-+#if SANITIZER_FREEBSD
-+// Get sys/_types.h, because that tells us whether 64-bit inodes are
-+// used in struct dirent below.
-+#include <sys/_types.h>
-+#endif
-+
- #ifndef __GLIBC_PREREQ
- #define __GLIBC_PREREQ(x, y) 0
- #endif
-@@ -37,7 +51,7 @@
- namespace __sanitizer {
- extern unsigned struct_utsname_sz;
- extern unsigned struct_stat_sz;
--#if !SANITIZER_FREEBSD && !SANITIZER_IOS
-+#if !SANITIZER_FREEBSD && !SANITIZER_IOS && !SANITIZER_NETBSD
- extern unsigned struct_stat64_sz;
- #endif
- extern unsigned struct_rusage_sz;
-@@ -55,8 +69,13 @@ namespace __sanitizer {
- extern unsigned struct_itimerspec_sz;
- extern unsigned struct_sigevent_sz;
- extern unsigned struct_sched_param_sz;
-+#if !SANITIZER_NETBSD
- extern unsigned struct_statfs64_sz;
-+#endif
-
-+#if !SANITIZER_ANDROID && !SANITIZER_NETBSD
-+ extern unsigned struct_statfs_sz;
-+#endif
- #if !SANITIZER_ANDROID
- extern unsigned struct_statfs_sz;
- extern unsigned struct_sockaddr_sz;
-@@ -127,12 +146,16 @@ namespace __sanitizer {
- #elif !defined(__sparc__)
- const unsigned struct___old_kernel_stat_sz = 32;
- #endif
-+#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-+
-+#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
-
- extern unsigned struct_rlimit_sz;
- extern unsigned struct_utimbuf_sz;
- extern unsigned struct_timespec_sz;
-
- struct __sanitizer_iocb {
-+#if SANITIZER_LINUX || SANITIZER_FREEBSD
- u64 aio_data;
- u32 aio_key_or_aio_reserved1; // Simply crazy.
- u32 aio_reserved1_or_aio_key; // Luckily, we don't need these.
-@@ -144,19 +167,40 @@ namespace __sanitizer {
- s64 aio_offset;
- u64 aio_reserved2;
- u64 aio_reserved3;
-+#elif SANITIZER_NETBSD
-+ u64 aio_offset;
-+ uptr aio_buf;
-+ long aio_nbytes;
-+ u32 aio_fildes;
-+ u32 aio_lio_opcode;
-+ long aio_reqprio;
-+#if _LP64
-+ u8 aio_sigevent[32];
-+#else
-+ u8 aio_sigevent[20];
-+#endif
-+ u32 _state;
-+ u32 _errno;
-+ long _retval;
-+#endif
- };
-+#endif
-
-+#if SANITIZER_LINUX || SANITIZER_FREEBSD
- struct __sanitizer_io_event {
- u64 data;
- u64 obj;
- u64 res;
- u64 res2;
- };
-+#endif
-
-+#if SANITIZER_LINUX || SANITIZER_FREEBSD
- const unsigned iocb_cmd_pread = 0;
- const unsigned iocb_cmd_pwrite = 1;
- const unsigned iocb_cmd_preadv = 7;
- const unsigned iocb_cmd_pwritev = 8;
-+#endif
-
- struct __sanitizer___sysctl_args {
- int *name;
-@@ -165,11 +209,16 @@ namespace __sanitizer {
- uptr *oldlenp;
- void *newval;
- uptr newlen;
-+#if SANITIZER_LINUX || SANITIZER_FREEBSD
- unsigned long ___unused[4];
-+#endif
- };
-
-+#if SANITIZER_LINUX || SANITIZER_FREEBSD
- const unsigned old_sigset_t_sz = sizeof(unsigned long);
-+#endif
-
-+#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
- struct __sanitizer_sem_t {
- #if SANITIZER_ANDROID && defined(_LP64)
- int data[4];
-@@ -179,9 +228,11 @@ namespace __sanitizer {
- uptr data[4];
- #elif SANITIZER_FREEBSD
- u32 data[4];
-+#elif SANITIZER_NETBSD
-+ uptr data[5];
- #endif
- };
--#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-+#endif // SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
-
- #if SANITIZER_ANDROID
- struct __sanitizer_mallinfo {
-@@ -324,14 +375,39 @@ namespace __sanitizer {
- unsigned long shm_dtime;
- unsigned long shm_ctime;
- };
-+
-+#elif SANITIZER_NETBSD
-+ struct __sanitizer_ipc_perm {
-+ u32 uid;
-+ u32 gid;
-+ u32 cuid;
-+ u32 cgid;
-+ u32 mode;
-+ unsigned short _seq;
-+ long _key;
-+ };
-+
-+ struct __sanitizer_shmid_ds {
-+ __sanitizer_ipc_perm shm_perm;
-+ unsigned long shm_segsz;
-+ u32 shm_lpid;
-+ u32 shm_cpid;
-+ unsigned int shm_nattch;
-+ u64 shm_atime;
-+ u64 shm_dtime;
-+ u64 shm_ctime;
-+ void *_shm_internal;
-+ };
- #endif
-
--#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#if (SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD) && \
-+ !SANITIZER_ANDROID
- extern unsigned struct_msqid_ds_sz;
- extern unsigned struct_mq_attr_sz;
- extern unsigned struct_timex_sz;
- extern unsigned struct_statvfs_sz;
--#endif // (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#endif // (SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD) &&
-+ // !SANITIZER_ANDROID
-
- struct __sanitizer_iovec {
- void *iov_base;
-@@ -351,6 +427,9 @@ namespace __sanitizer {
- # endif
- void *ifa_dstaddr; // (struct sockaddr *)
- void *ifa_data;
-+#if SANITIZER_NETBSD
-+ unsigned int ifa_addrflags;
-+#endif
- };
- #endif // !SANITIZER_ANDROID
-
-@@ -376,13 +455,19 @@ namespace __sanitizer {
- const int __sanitizer_XDR_FREE = 2;
- #endif
-
-+#if SANITIZER_NETBSD || (defined(__x86_64__) && !defined(_LP64))
-+ typedef long long __sanitizer_time_t;
-+#else
-+ typedef long __sanitizer_time_t;
-+#endif
-+
- struct __sanitizer_passwd {
- char *pw_name;
- char *pw_passwd;
- int pw_uid;
- int pw_gid;
--#if SANITIZER_MAC || SANITIZER_FREEBSD
-- long pw_change;
-+#if SANITIZER_MAC || SANITIZER_FREEBSD || SANITIZER_NETBSD
-+ __sanitizer_time_t pw_change;
- char *pw_class;
- #endif
- #if !(SANITIZER_ANDROID && (SANITIZER_WORDSIZE == 32))
-@@ -390,8 +475,8 @@ namespace __sanitizer {
- #endif
- char *pw_dir;
- char *pw_shell;
--#if SANITIZER_MAC || SANITIZER_FREEBSD
-- long pw_expire;
-+#if SANITIZER_MAC || SANITIZER_FREEBSD || SANITIZER_NETBSD
-+ __sanitizer_time_t pw_expire;
- #endif
- #if SANITIZER_FREEBSD
- int pw_fields;
-@@ -405,12 +490,6 @@ namespace __sanitizer {
- char **gr_mem;
- };
-
--#if defined(__x86_64__) && !defined(_LP64)
-- typedef long long __sanitizer_time_t;
--#else
-- typedef long __sanitizer_time_t;
--#endif
--
- struct __sanitizer_timeb {
- __sanitizer_time_t time;
- unsigned short millitm;
-@@ -447,7 +526,7 @@ namespace __sanitizer {
- };
- #endif
-
--#if SANITIZER_MAC || SANITIZER_FREEBSD
-+#if SANITIZER_MAC || SANITIZER_FREEBSD || SANITIZER_NETBSD
- struct __sanitizer_msghdr {
- void *msg_name;
- unsigned msg_namelen;
-@@ -497,6 +576,12 @@ namespace __sanitizer {
- unsigned short d_reclen;
- // more fields that we don't care about
- };
-+#elif SANITIZER_NETBSD
-+ struct __sanitizer_dirent {
-+ u64 d_fileno;
-+ u16 d_reclen;
-+ // more fields that we don't care about
-+ };
- #elif SANITIZER_ANDROID || defined(__x86_64__)
- struct __sanitizer_dirent {
- unsigned long long d_ino;
-@@ -522,8 +607,7 @@ namespace __sanitizer {
- };
- #endif
-
--// 'clock_t' is 32 bits wide on x64 FreeBSD
--#if SANITIZER_FREEBSD
-+#if SANITIZER_FREEBSD || SANITIZER_NETBSD
- typedef int __sanitizer_clock_t;
- #elif defined(__x86_64__) && !defined(_LP64)
- typedef long long __sanitizer_clock_t;
-@@ -531,7 +615,7 @@ namespace __sanitizer {
- typedef long __sanitizer_clock_t;
- #endif
-
--#if SANITIZER_LINUX
-+#if SANITIZER_LINUX || SANITIZER_NETBSD
- typedef int __sanitizer_clockid_t;
- #endif
-
-@@ -562,8 +646,22 @@ namespace __sanitizer {
- typedef struct {
- unsigned long fds_bits[1024 / (8 * sizeof(long))];
- } __sanitizer___kernel_fd_set;
-+#elif SANITIZER_NETBSD
-+ typedef u32 __sanitizer___kernel_uid_t;
-+ typedef u32 __sanitizer___kernel_gid_t;
-+ typedef u64 __sanitizer___kernel_off_t;
-+ typedef struct {
-+ u32 fds_bits[8];
-+ } __sanitizer___kernel_fd_set;
- #endif
+@@ -15,6 +15,10 @@
+ #ifndef SANITIZER_PLATFORM_LIMITS_POSIX_H
+ #define SANITIZER_PLATFORM_LIMITS_POSIX_H
+#if SANITIZER_NETBSD
-+ typedef struct {
-+ unsigned int pta_magic;
-+ int pta_flags;
-+ void *pta_private;
-+ } __sanitizer_pthread_attr_t;
-+#else
- // This thing depends on the platform. We are only interested in the upper
- // limit. Verified with a compiler assert in .cc.
- const int pthread_attr_t_max_sz = 128;
-@@ -571,6 +669,7 @@ namespace __sanitizer {
- char size[pthread_attr_t_max_sz]; // NOLINT
- void *align;
- };
-+#endif
-
- #if SANITIZER_ANDROID
- # if SANITIZER_MIPS
-@@ -585,7 +684,7 @@ namespace __sanitizer {
- // The size is determined by looking at sizeof of real sigset_t on linux.
- uptr val[128 / sizeof(uptr)];
- };
--#elif SANITIZER_FREEBSD
-+#elif SANITIZER_FREEBSD || SANITIZER_NETBSD
- struct __sanitizer_sigset_t {
- // uint32_t * 4
- unsigned int __bits[4];
-@@ -622,7 +721,16 @@ namespace __sanitizer {
- uptr sa_flags;
- void (*sa_restorer)();
- };
--#else // !SANITIZER_ANDROID
-+#elif SANITIZER_NETBSD
-+ struct __sanitizer_sigaction {
-+ union {
-+ void (*handler)(int sig);
-+ void (*sigaction)(int sig, void *siginfo, void *uctx);
-+ };
-+ __sanitizer_sigset_t sa_mask;
-+ int sa_flags;
-+ };
-+#else
- struct __sanitizer_sigaction {
- #if defined(__mips__) && !SANITIZER_FREEBSD
- unsigned int sa_flags;
-@@ -670,7 +778,7 @@ namespace __sanitizer {
- };
- #endif // !SANITIZER_ANDROID
-
--#if SANITIZER_FREEBSD
-+#if SANITIZER_FREEBSD || SANITIZER_NETBSD
- typedef __sanitizer_sigset_t __sanitizer_kernel_sigset_t;
- #elif defined(__mips__)
- struct __sanitizer_kernel_sigset_t {
-@@ -717,7 +825,7 @@ namespace __sanitizer {
- extern int af_inet6;
- uptr __sanitizer_in_addr_sz(int af);
-
--#if SANITIZER_LINUX || SANITIZER_FREEBSD
-+#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
- struct __sanitizer_dl_phdr_info {
- uptr dlpi_addr;
- const char *dlpi_name;
-@@ -733,7 +841,7 @@ namespace __sanitizer {
- int ai_family;
- int ai_socktype;
- int ai_protocol;
--#if SANITIZER_ANDROID || SANITIZER_MAC || SANITIZER_FREEBSD
-+#if SANITIZER_ANDROID || SANITIZER_MAC || SANITIZER_FREEBSD || SANITIZER_NETBSD
- unsigned ai_addrlen;
- char *ai_canonname;
- void *ai_addr;
-@@ -759,7 +867,7 @@ namespace __sanitizer {
- short revents;
- };
-
--#if SANITIZER_ANDROID || SANITIZER_MAC || SANITIZER_FREEBSD
-+#if SANITIZER_ANDROID || SANITIZER_MAC || SANITIZER_FREEBSD || SANITIZER_NETBSD
- typedef unsigned __sanitizer_nfds_t;
- #else
- typedef unsigned long __sanitizer_nfds_t;
-@@ -779,7 +887,7 @@ namespace __sanitizer {
- int (*gl_lstat)(const char *, void *);
- int (*gl_stat)(const char *, void *);
- };
--# elif SANITIZER_FREEBSD
-+#elif SANITIZER_FREEBSD || SANITIZER_NETBSD
- struct __sanitizer_glob_t {
- uptr gl_pathc;
- uptr gl_matchc;
-@@ -793,9 +901,9 @@ namespace __sanitizer {
- int (*gl_lstat)(const char*, void* /* struct stat* */);
- int (*gl_stat)(const char*, void* /* struct stat* */);
- };
--# endif // SANITIZER_FREEBSD
-+#endif // SANITIZER_FREEBSD || SANITIZER_NETBSD
-
--# if SANITIZER_LINUX || SANITIZER_FREEBSD
-+#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
- extern int glob_nomatch;
- extern int glob_altdirfunc;
- # endif
-@@ -807,7 +915,7 @@ namespace __sanitizer {
- uptr we_wordc;
- char **we_wordv;
- uptr we_offs;
--#if SANITIZER_FREEBSD
-+#if SANITIZER_FREEBSD || SANITIZER_NETBSD
- char *we_strings;
- uptr we_nbytes;
- #endif
-@@ -864,7 +972,8 @@ namespace __sanitizer {
- extern int ptrace_geteventmsg;
- #endif
-
--#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#if (SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD) && \
-+ !SANITIZER_ANDROID
- extern unsigned struct_shminfo_sz;
- extern unsigned struct_shm_info_sz;
- extern int shmctl_ipc_stat;
-@@ -967,38 +1076,41 @@ struct __sanitizer_cookie_io_functions_t
- #define IOC_SIZE(nr) (((nr) >> IOC_SIZESHIFT) & IOC_SIZEMASK)
- #endif
-
-- extern unsigned struct_ifreq_sz;
-- extern unsigned struct_termios_sz;
-- extern unsigned struct_winsize_sz;
-+extern unsigned struct_ifreq_sz;
-+extern unsigned struct_termios_sz;
-+extern unsigned struct_winsize_sz;
-+
-+#if SANITIZER_LINUX || SANITIZER_NETBSD
-+extern unsigned struct_arpreq_sz;
-+#endif
-
- #if SANITIZER_LINUX
-- extern unsigned struct_arpreq_sz;
-- extern unsigned struct_cdrom_msf_sz;
-- extern unsigned struct_cdrom_multisession_sz;
-- extern unsigned struct_cdrom_read_audio_sz;
-- extern unsigned struct_cdrom_subchnl_sz;
-- extern unsigned struct_cdrom_ti_sz;
-- extern unsigned struct_cdrom_tocentry_sz;
-- extern unsigned struct_cdrom_tochdr_sz;
-- extern unsigned struct_cdrom_volctrl_sz;
-- extern unsigned struct_ff_effect_sz;
-- extern unsigned struct_floppy_drive_params_sz;
-- extern unsigned struct_floppy_drive_struct_sz;
-- extern unsigned struct_floppy_fdc_state_sz;
-- extern unsigned struct_floppy_max_errors_sz;
-- extern unsigned struct_floppy_raw_cmd_sz;
-- extern unsigned struct_floppy_struct_sz;
-- extern unsigned struct_floppy_write_errors_sz;
-- extern unsigned struct_format_descr_sz;
-- extern unsigned struct_hd_driveid_sz;
-- extern unsigned struct_hd_geometry_sz;
-- extern unsigned struct_input_absinfo_sz;
-- extern unsigned struct_input_id_sz;
-- extern unsigned struct_mtpos_sz;
-- extern unsigned struct_termio_sz;
-- extern unsigned struct_vt_consize_sz;
-- extern unsigned struct_vt_sizes_sz;
-- extern unsigned struct_vt_stat_sz;
-+extern unsigned struct_cdrom_msf_sz;
-+extern unsigned struct_cdrom_multisession_sz;
-+extern unsigned struct_cdrom_read_audio_sz;
-+extern unsigned struct_cdrom_subchnl_sz;
-+extern unsigned struct_cdrom_ti_sz;
-+extern unsigned struct_cdrom_tocentry_sz;
-+extern unsigned struct_cdrom_tochdr_sz;
-+extern unsigned struct_cdrom_volctrl_sz;
-+extern unsigned struct_ff_effect_sz;
-+extern unsigned struct_floppy_drive_params_sz;
-+extern unsigned struct_floppy_drive_struct_sz;
-+extern unsigned struct_floppy_fdc_state_sz;
-+extern unsigned struct_floppy_max_errors_sz;
-+extern unsigned struct_floppy_raw_cmd_sz;
-+extern unsigned struct_floppy_struct_sz;
-+extern unsigned struct_floppy_write_errors_sz;
-+extern unsigned struct_format_descr_sz;
-+extern unsigned struct_hd_driveid_sz;
-+extern unsigned struct_hd_geometry_sz;
-+extern unsigned struct_input_absinfo_sz;
-+extern unsigned struct_input_id_sz;
-+extern unsigned struct_mtpos_sz;
-+extern unsigned struct_termio_sz;
-+extern unsigned struct_vt_consize_sz;
-+extern unsigned struct_vt_sizes_sz;
-+extern unsigned struct_vt_stat_sz;
- #endif // SANITIZER_LINUX
-
- #if SANITIZER_LINUX || SANITIZER_FREEBSD
-@@ -1006,6 +1118,9 @@ struct __sanitizer_cookie_io_functions_t
- extern unsigned struct_copr_debug_buf_sz;
- extern unsigned struct_copr_msg_sz;
- extern unsigned struct_midi_info_sz;
++#error include sanitizer_platform_limits_netbsd.h on NetBSD
+#endif
+
-+#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
- extern unsigned struct_mtget_sz;
- extern unsigned struct_mtop_sz;
- extern unsigned struct_rtentry_sz;
-@@ -1013,7 +1128,7 @@ struct __sanitizer_cookie_io_functions_t
- extern unsigned struct_seq_event_rec_sz;
- extern unsigned struct_synth_info_sz;
- extern unsigned struct_vt_mode_sz;
--#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-+#endif // SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
-
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
- extern unsigned struct_ax25_parms_struct_sz;
-@@ -1035,10 +1150,12 @@ struct __sanitizer_cookie_io_functions_t
- extern unsigned struct_unimapinit_sz;
- #endif // SANITIZER_LINUX && !SANITIZER_ANDROID
-
--#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#if (SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD) && \
-+ !SANITIZER_ANDROID
- extern unsigned struct_audio_buf_info_sz;
- extern unsigned struct_ppp_stats_sz;
--#endif // (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#endif // (SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD) &&
-+ // !SANITIZER_ANDROID
-
- #if !SANITIZER_ANDROID && !SANITIZER_MAC
- extern unsigned struct_sioc_sg_req_sz;
-@@ -1095,7 +1212,8 @@ struct __sanitizer_cookie_io_functions_t
- extern unsigned IOCTL_TIOCSPGRP;
- extern unsigned IOCTL_TIOCSTI;
- extern unsigned IOCTL_TIOCSWINSZ;
--#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#if (SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD) && \
-+ !SANITIZER_ANDROID
- extern unsigned IOCTL_SIOCGETSGCNT;
- extern unsigned IOCTL_SIOCGETVIFCNT;
- #endif
-@@ -1258,7 +1376,7 @@ struct __sanitizer_cookie_io_functions_t
- extern unsigned IOCTL_VT_RESIZEX;
- extern unsigned IOCTL_VT_SENDSIG;
- #endif // SANITIZER_LINUX
--#if SANITIZER_LINUX || SANITIZER_FREEBSD
-+#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
- extern unsigned IOCTL_MTIOCGET;
- extern unsigned IOCTL_MTIOCTOP;
- extern unsigned IOCTL_SIOCADDRT;
-@@ -1359,7 +1477,7 @@ struct __sanitizer_cookie_io_functions_t
- extern unsigned IOCTL_VT_RELDISP;
- extern unsigned IOCTL_VT_SETMODE;
- extern unsigned IOCTL_VT_WAITACTIVE;
--#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-+#endif // SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
-
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
- extern unsigned IOCTL_CYGETDEFTHRESH;
-@@ -1448,21 +1566,28 @@ struct __sanitizer_cookie_io_functions_t
- extern unsigned IOCTL_TIOCSSERIAL;
- #endif // SANITIZER_LINUX && !SANITIZER_ANDROID
-
--#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#if (SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD) && \
-+ !SANITIZER_ANDROID
-+#if !SANITIZER_NETBSD
- extern unsigned IOCTL_GIO_SCRNMAP;
-+#endif
- extern unsigned IOCTL_KDDISABIO;
- extern unsigned IOCTL_KDENABIO;
- extern unsigned IOCTL_KDGETLED;
-+#if !SANITIZER_NETBSD
- extern unsigned IOCTL_KDGETMODE;
-+#endif
- extern unsigned IOCTL_KDGKBMODE;
- extern unsigned IOCTL_KDGKBTYPE;
- extern unsigned IOCTL_KDMKTONE;
- extern unsigned IOCTL_KDSETLED;
- extern unsigned IOCTL_KDSETMODE;
- extern unsigned IOCTL_KDSKBMODE;
-+#if !SANITIZER_NETBSD
- extern unsigned IOCTL_KIOCSOUND;
- extern unsigned IOCTL_PIO_SCRNMAP;
- #endif
-+#endif
+ #include "sanitizer_internal_defs.h"
+ #include "sanitizer_platform.h"
- extern const int si_SEGV_MAPERR;
- extern const int si_SEGV_ACCERR;
Home |
Main Index |
Thread Index |
Old Index