From: Christophe Lyon Date: Mon, 23 Mar 2015 13:43:22 +0000 (+0000) Subject: re PR sanitizer/59009 (libsanitizer merge from upstream r191666 breaks bootstrap... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d886f7cc3376e5f61e39e860401a10dab5b8f5d8;p=gcc.git re PR sanitizer/59009 (libsanitizer merge from upstream r191666 breaks bootstrap on powerpc64-linux and aarch64-linux) 2015-03-23 Christophe Lyon PR sanitizer/59009 * sanitizer_common/sanitizer_platform_limits_posix.cc: Cherry pick upstream r230324. * sanitizer_common/sanitizer_platform.h: Likewise. * sanitizer_common/sanitizer_common_syscalls.inc: Likewise. From-SVN: r221593 --- diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog index 6086c09c46c..282afed1e33 100644 --- a/libsanitizer/ChangeLog +++ b/libsanitizer/ChangeLog @@ -1,3 +1,11 @@ +2015-03-23 Christophe Lyon + + PR sanitizer/59009 + * sanitizer_common/sanitizer_platform_limits_posix.cc: Cherry pick + upstream r230324. + * sanitizer_common/sanitizer_platform.h: Likewise. + * sanitizer_common/sanitizer_common_syscalls.inc: Likewise. + 2015-03-11 Bernd Edlinger * tsan/tsan_rtl_report.cc (ScopedReport::AddThread): Cherry pick diff --git a/libsanitizer/sanitizer_common/sanitizer_common_syscalls.inc b/libsanitizer/sanitizer_common/sanitizer_common_syscalls.inc index 24e1b7ec452..104c27cd5d2 100644 --- a/libsanitizer/sanitizer_common/sanitizer_common_syscalls.inc +++ b/libsanitizer/sanitizer_common/sanitizer_common_syscalls.inc @@ -1441,6 +1441,7 @@ PRE_SYSCALL(fchown)(long fd, long user, long group) {} POST_SYSCALL(fchown)(long res, long fd, long user, long group) {} +#if SANITIZER_USES_UID16_SYSCALLS PRE_SYSCALL(chown16)(const void *filename, long user, long group) { if (filename) PRE_READ(filename, @@ -1550,6 +1551,7 @@ POST_SYSCALL(getgid16)(long res) {} PRE_SYSCALL(getegid16)() {} POST_SYSCALL(getegid16)(long res) {} +#endif // SANITIZER_USES_UID16_SYSCALLS PRE_SYSCALL(utime)(void *filename, void *times) {} diff --git a/libsanitizer/sanitizer_common/sanitizer_platform.h b/libsanitizer/sanitizer_common/sanitizer_platform.h index 7064b7166b0..55bec90b080 100644 --- a/libsanitizer/sanitizer_common/sanitizer_platform.h +++ b/libsanitizer/sanitizer_common/sanitizer_platform.h @@ -107,6 +107,19 @@ # endif #endif +// udi16 syscalls can only be used when the following conditions are +// met: +// * target is one of arm32, x86-32, sparc32, sh or m68k +// * libc version is libc5, glibc-2.0, glibc-2.1 or glibc-2.2 to 2.15 +// built against > linux-2.2 kernel headers +// Since we don't want to include libc headers here, we check the +// target only. +#if defined(__arm__) || SANITIZER_X32 || defined(__sparc__) +#define SANITIZER_USES_UID16_SYSCALLS 1 +#else +#define SANITIZER_USES_UID16_SYSCALLS 0 +#endif + #ifdef __mips__ # define SANITIZER_POINTER_FORMAT_LENGTH FIRST_32_SECOND_64(8, 10) #else diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc index 199a842447a..4971c4075bc 100644 --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc @@ -1004,7 +1004,7 @@ CHECK_SIZE_AND_OFFSET(__sysctl_args, newlen); CHECK_TYPE_SIZE(__kernel_uid_t); CHECK_TYPE_SIZE(__kernel_gid_t); -#if !defined(__aarch64__) +#if SANITIZER_USES_UID16_SYSCALLS CHECK_TYPE_SIZE(__kernel_old_uid_t); CHECK_TYPE_SIZE(__kernel_old_gid_t); #endif