From: H.J. Lu Date: Wed, 4 May 2022 21:53:05 +0000 (-0700) Subject: [sanitizer] Use newfstatat for x32 X-Git-Tag: upstream/15.0.7~8612 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f52e365092aa08f35b9e2b0d9b8410780c7be39a;p=platform%2Fupstream%2Fllvm.git [sanitizer] Use newfstatat for x32 Since newfstatat is supported on x32, use it for x32. Differential Revision: https://reviews.llvm.org/D124968 --- diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp index 8e144a4..e2c32d6 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp @@ -343,7 +343,7 @@ uptr internal_stat(const char *path, void *buf) { #if SANITIZER_FREEBSD return internal_syscall(SYSCALL(fstatat), AT_FDCWD, (uptr)path, (uptr)buf, 0); # elif SANITIZER_LINUX -# if SANITIZER_WORDSIZE == 64 +# if SANITIZER_WORDSIZE == 64 || SANITIZER_X32 return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, (uptr)buf, 0); # else @@ -366,7 +366,7 @@ uptr internal_lstat(const char *path, void *buf) { return internal_syscall(SYSCALL(fstatat), AT_FDCWD, (uptr)path, (uptr)buf, AT_SYMLINK_NOFOLLOW); # elif SANITIZER_LINUX -# if defined(_LP64) +# if defined(_LP64) || SANITIZER_X32 return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, (uptr)buf, AT_SYMLINK_NOFOLLOW); # else