diff options
-rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h | 20 | ||||
-rw-r--r-- | compiler-rt/test/sanitizer_common/TestCases/Posix/access.cc (renamed from compiler-rt/test/sanitizer_common/TestCases/NetBSD/access.cc) | 0 | ||||
-rw-r--r-- | compiler-rt/test/sanitizer_common/TestCases/Posix/devname.cc (renamed from compiler-rt/test/sanitizer_common/TestCases/NetBSD/devname.cc) | 1 | ||||
-rw-r--r-- | compiler-rt/test/sanitizer_common/TestCases/Posix/devname_r.cc (renamed from compiler-rt/test/sanitizer_common/TestCases/NetBSD/devname_r.cc) | 3 | ||||
-rw-r--r-- | compiler-rt/test/sanitizer_common/TestCases/Posix/fgetln.cc (renamed from compiler-rt/test/sanitizer_common/TestCases/NetBSD/fgetln.cc) | 1 | ||||
-rw-r--r-- | compiler-rt/test/sanitizer_common/TestCases/Posix/getpass.cc | 8 | ||||
-rw-r--r-- | compiler-rt/test/sanitizer_common/TestCases/Posix/lstat.cc (renamed from compiler-rt/test/sanitizer_common/TestCases/NetBSD/lstat.cc) | 0 | ||||
-rw-r--r-- | compiler-rt/test/sanitizer_common/TestCases/Posix/strlcat.cc (renamed from compiler-rt/test/sanitizer_common/TestCases/NetBSD/strlcat.cc) | 2 | ||||
-rw-r--r-- | compiler-rt/test/sanitizer_common/TestCases/Posix/strlcpy.cc (renamed from compiler-rt/test/sanitizer_common/TestCases/NetBSD/strlcpy.cc) | 2 | ||||
-rw-r--r-- | compiler-rt/test/sanitizer_common/lit.common.cfg | 2 |
10 files changed, 26 insertions, 13 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h index c751f3c9119..56102c9075a 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h @@ -432,7 +432,7 @@ #define SANITIZER_INTERCEPT_STAT \ (SI_FREEBSD || SI_MAC || SI_ANDROID || SI_NETBSD || SI_OPENBSD || SI_SOLARIS) -#define SANITIZER_INTERCEPT_LSTAT SI_NETBSD +#define SANITIZER_INTERCEPT_LSTAT (SI_NETBSD || SI_FREEBSD) #define SANITIZER_INTERCEPT___XSTAT (!SANITIZER_INTERCEPT_STAT && SI_POSIX) #define SANITIZER_INTERCEPT___XSTAT64 SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT___LXSTAT SANITIZER_INTERCEPT___XSTAT @@ -463,16 +463,16 @@ #define SANITIZER_INTERCEPT_SIGNAL_AND_SIGACTION (!SI_WINDOWS && SI_NOT_FUCHSIA) #define SANITIZER_INTERCEPT_BSD_SIGNAL SI_ANDROID -#define SANITIZER_INTERCEPT_ACCT (SI_NETBSD || SI_OPENBSD) +#define SANITIZER_INTERCEPT_ACCT (SI_NETBSD || SI_OPENBSD || SI_FREEBSD) #define SANITIZER_INTERCEPT_USER_FROM_UID SI_NETBSD #define SANITIZER_INTERCEPT_UID_FROM_USER SI_NETBSD #define SANITIZER_INTERCEPT_GROUP_FROM_GID SI_NETBSD #define SANITIZER_INTERCEPT_GID_FROM_GROUP SI_NETBSD -#define SANITIZER_INTERCEPT_ACCESS (SI_NETBSD || SI_OPENBSD) -#define SANITIZER_INTERCEPT_FACCESSAT (SI_NETBSD || SI_OPENBSD) +#define SANITIZER_INTERCEPT_ACCESS (SI_NETBSD || SI_OPENBSD || SI_FREEBSD) +#define SANITIZER_INTERCEPT_FACCESSAT (SI_NETBSD || SI_OPENBSD || SI_FREEBSD) #define SANITIZER_INTERCEPT_GETGROUPLIST (SI_NETBSD || SI_OPENBSD) -#define SANITIZER_INTERCEPT_GETGROUPMEMBERSHIP SI_NETBSD -#define SANITIZER_INTERCEPT_STRLCPY (SI_NETBSD || SI_OPENBSD) +#define SANITIZER_INTERCEPT_STRLCPY \ + (SI_NETBSD || SI_FREEBSD || SI_OPENBSD || SI_MAC || SI_ANDROID) #define SANITIZER_INTERCEPT_NAME_TO_HANDLE_AT SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_OPEN_BY_HANDLE_AT SI_LINUX_NOT_ANDROID @@ -487,10 +487,10 @@ #define SANITIZER_INTERCEPT_READLINKAT \ (SI_POSIX && !SI_MAC_DEPLOYMENT_BELOW_10_10) -#define SANITIZER_INTERCEPT_DEVNAME (SI_NETBSD || SI_OPENBSD) -#define SANITIZER_INTERCEPT_DEVNAME_R SI_NETBSD -#define SANITIZER_INTERCEPT_FGETLN SI_NETBSD -#define SANITIZER_INTERCEPT_STRMODE SI_NETBSD +#define SANITIZER_INTERCEPT_DEVNAME (SI_NETBSD || SI_OPENBSD || SI_FREEBSD) +#define SANITIZER_INTERCEPT_DEVNAME_R (SI_NETBSD || SI_FREEBSD) +#define SANITIZER_INTERCEPT_FGETLN (SI_NETBSD || SI_FREEBSD) +#define SANITIZER_INTERCEPT_STRMODE (SI_NETBSD || SI_FREEBSD) #define SANITIZER_INTERCEPT_TTYENT SI_NETBSD #define SANITIZER_INTERCEPT_PROTOENT SI_NETBSD #define SANITIZER_INTERCEPT_NETENT SI_NETBSD diff --git a/compiler-rt/test/sanitizer_common/TestCases/NetBSD/access.cc b/compiler-rt/test/sanitizer_common/TestCases/Posix/access.cc index 92c2a9fd847..92c2a9fd847 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/NetBSD/access.cc +++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/access.cc diff --git a/compiler-rt/test/sanitizer_common/TestCases/NetBSD/devname.cc b/compiler-rt/test/sanitizer_common/TestCases/Posix/devname.cc index 8cde9eb3c4b..da4bb8853a1 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/NetBSD/devname.cc +++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/devname.cc @@ -1,4 +1,5 @@ // RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s +// UNSUPPORTED: linux, solaris #include <stdio.h> #include <stdlib.h> diff --git a/compiler-rt/test/sanitizer_common/TestCases/NetBSD/devname_r.cc b/compiler-rt/test/sanitizer_common/TestCases/Posix/devname_r.cc index ef65dfd9322..f7925f55597 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/NetBSD/devname_r.cc +++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/devname_r.cc @@ -1,4 +1,5 @@ // RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s +// UNSUPPORTED: linux, solaris #include <sys/cdefs.h> #include <sys/stat.h> @@ -16,7 +17,7 @@ int main(void) { type = S_ISCHR(st.st_mode) ? S_IFCHR : S_IFBLK; - if (devname_r(st.st_rdev, type, name, __arraycount(name))) + if (devname_r(st.st_rdev, type, name, sizeof(name))) exit(1); printf("%s\n", name); diff --git a/compiler-rt/test/sanitizer_common/TestCases/NetBSD/fgetln.cc b/compiler-rt/test/sanitizer_common/TestCases/Posix/fgetln.cc index 2c4f83d4652..e98cf449a27 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/NetBSD/fgetln.cc +++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/fgetln.cc @@ -1,4 +1,5 @@ // RUN: %clangxx -O0 -g %s -o %t && %run %t +// UNSUPPORTED: linux #include <stdio.h> #include <stdlib.h> diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/getpass.cc b/compiler-rt/test/sanitizer_common/TestCases/Posix/getpass.cc index b91a3d7d526..bf198eff91d 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Posix/getpass.cc +++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/getpass.cc @@ -5,13 +5,19 @@ #include <assert.h> #include <stdio.h> -#include <unistd.h> #include <string.h> #if __linux__ #include <pty.h> +#elif defined(__FreeBSD__) +#include <libutil.h> +#include <pwd.h> +#include <sys/ioctl.h> +#include <sys/termios.h> +#include <sys/types.h> #else #include <util.h> #endif +#include <unistd.h> int main (int argc, char** argv) diff --git a/compiler-rt/test/sanitizer_common/TestCases/NetBSD/lstat.cc b/compiler-rt/test/sanitizer_common/TestCases/Posix/lstat.cc index 37237d82102..37237d82102 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/NetBSD/lstat.cc +++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/lstat.cc diff --git a/compiler-rt/test/sanitizer_common/TestCases/NetBSD/strlcat.cc b/compiler-rt/test/sanitizer_common/TestCases/Posix/strlcat.cc index ea504589e3e..bdabada76aa 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/NetBSD/strlcat.cc +++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/strlcat.cc @@ -1,5 +1,7 @@ // RUN: %clangxx -O0 -g %s -o %t && %run %t +// UNSUPPORTED: linux + #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/compiler-rt/test/sanitizer_common/TestCases/NetBSD/strlcpy.cc b/compiler-rt/test/sanitizer_common/TestCases/Posix/strlcpy.cc index 99634860273..83053911d96 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/NetBSD/strlcpy.cc +++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/strlcpy.cc @@ -1,5 +1,7 @@ // RUN: %clangxx -O0 -g %s -o %t && %run %t +// UNSUPPORTED: linux + #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/compiler-rt/test/sanitizer_common/lit.common.cfg b/compiler-rt/test/sanitizer_common/lit.common.cfg index 72e3e5e1085..0e9183b1bdd 100644 --- a/compiler-rt/test/sanitizer_common/lit.common.cfg +++ b/compiler-rt/test/sanitizer_common/lit.common.cfg @@ -59,5 +59,5 @@ config.substitutions.append( ('%env_tool_opts=', config.suffixes = ['.c', '.cc', '.cpp'] -if config.host_os not in ['Linux', 'Darwin', 'NetBSD']: +if config.host_os not in ['Linux', 'Darwin', 'NetBSD', 'FreeBSD']: config.unsupported = True |