diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2015-03-23 13:43:22 +0000 |
---|---|---|
committer | Christophe Lyon <clyon@gcc.gnu.org> | 2015-03-23 14:43:22 +0100 |
commit | d886f7cc3376e5f61e39e860401a10dab5b8f5d8 (patch) | |
tree | aafa1460146af840a6857be6db498c08b4098ff9 | |
parent | 89d390e57a34432f9a8f14b752eec061fcb2b64e (diff) | |
download | gcc-d886f7cc3376e5f61e39e860401a10dab5b8f5d8.zip gcc-d886f7cc3376e5f61e39e860401a10dab5b8f5d8.tar.gz gcc-d886f7cc3376e5f61e39e860401a10dab5b8f5d8.tar.bz2 |
re PR sanitizer/59009 (libsanitizer merge from upstream r191666 breaks bootstrap on powerpc64-linux and aarch64-linux)
2015-03-23 Christophe Lyon <christophe.lyon@linaro.org>
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
4 files changed, 24 insertions, 1 deletions
diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog index 6086c09..282afed 100644 --- a/libsanitizer/ChangeLog +++ b/libsanitizer/ChangeLog @@ -1,3 +1,11 @@ +2015-03-23 Christophe Lyon <christophe.lyon@linaro.org> + + 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 <bernd.edlinger@hotmail.de> * 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 24e1b7e..104c27c 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 7064b71..55bec90 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 199a842..4971c40 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 |