diff mbox series

Add missing libsanitizer extra patch (r259664) (PR sanitizer/89941).

Message ID 7997ca64-f673-8486-8e3b-7bf08f524ff6@suse.cz
State New
Headers show
Series Add missing libsanitizer extra patch (r259664) (PR sanitizer/89941). | expand

Commit Message

Martin Liška April 3, 2019, 8:09 a.m. UTC
Hi.

The patch is about re-application of what we've already had
on top trunk libsanitizer. I'll then include the patch in libsanitizer/LOCAL_PATCHES.

Ready for trunk?
Thanks,
Martin

libsanitizer/ChangeLog:

2019-04-03  Martin Liska  <mliska@suse.cz>

	PR sanitizer/89941
	* sanitizer_common/sanitizer_platform_limits_linux.cc (defined):
	Reapply patch from r259664.
	* sanitizer_common/sanitizer_platform_limits_posix.h (defined):
	Likewise.
---
 .../sanitizer_common/sanitizer_platform_limits_linux.cc    | 7 +++++--
 .../sanitizer_common/sanitizer_platform_limits_posix.h     | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

Comments

Jakub Jelinek April 8, 2019, 12:21 p.m. UTC | #1
On Wed, Apr 03, 2019 at 10:09:19AM +0200, Martin Liška wrote:
> Hi.
> 
> The patch is about re-application of what we've already had
> on top trunk libsanitizer. I'll then include the patch in libsanitizer/LOCAL_PATCHES.
> 
> Ready for trunk?
> Thanks,
> Martin
> 
> libsanitizer/ChangeLog:
> 
> 2019-04-03  Martin Liska  <mliska@suse.cz>
> 
> 	PR sanitizer/89941
> 	* sanitizer_common/sanitizer_platform_limits_linux.cc (defined):
> 	Reapply patch from r259664.
> 	* sanitizer_common/sanitizer_platform_limits_posix.h (defined):
> 	Likewise.

Ok.

	Jakub
diff mbox series

Patch

diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cc
index 23a014823c4..3a906538129 100644
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cc
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cc
@@ -25,9 +25,12 @@ 
 
 // With old kernels (and even new kernels on powerpc) asm/stat.h uses types that
 // are not defined anywhere in userspace headers. Fake them. This seems to work
-// fine with newer headers, too.
+// fine with newer headers, too.  Beware that with <sys/stat.h>, struct stat
+// takes the form of struct stat64 on 32-bit platforms if _FILE_OFFSET_BITS=64.
+// Also, for some platforms (e.g. mips) there are additional members in the
+// <sys/stat.h> struct stat:s.
 #include <linux/posix_types.h>
-#if defined(__x86_64__) ||  defined(__mips__)
+#if defined(__x86_64__)
 #include <sys/stat.h>
 #else
 #define ino_t __kernel_ino_t
diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
index 91f38918f35..73af92af1e8 100644
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -87,7 +87,7 @@  namespace __sanitizer {
 #elif defined(__mips__)
   const unsigned struct_kernel_stat_sz =
                  SANITIZER_ANDROID ? FIRST_32_SECOND_64(104, 128) :
-                                     FIRST_32_SECOND_64(160, 216);
+                                     FIRST_32_SECOND_64(144, 216);
   const unsigned struct_kernel_stat64_sz = 104;
 #elif defined(__s390__) && !defined(__s390x__)
   const unsigned struct_kernel_stat_sz = 64;