Re: [PATCH] libsanitizer: Cherry-pick 2bfb0fcb51510f22723c8cdfefe from upstream

2022-07-31 Thread Martin Liška
On 7/29/22 08:38, Dimitrije Milosevic wrote:
> Thanks Martin! I'm sending out the output from git format-patch as an 
> attachment to this email.

You're welcome, pushed as r13-1909-g1efeaf99bd8bdf.

Cheers,
Martin


Re: [PATCH] libsanitizer: Cherry-pick 2bfb0fcb51510f22723c8cdfefe from upstream

2022-07-29 Thread Dimitrije Milosevic
Thanks Martin! I'm sending out the output from git format-patch as an 
attachment to this email.


From: Martin Liška 
Sent: Thursday, July 28, 2022 3:48 PM
To: Dimitrije Milosevic ; 
gcc-patches@gcc.gnu.org 
Cc: ma...@embecosm.com ; Djordje Todorovic 
; jos...@codesourcery.com 

Subject: Re: [PATCH] libsanitizer: Cherry-pick 2bfb0fcb51510f22723c8cdfefe from 
upstream 
 
On 7/28/22 15:43, Dimitrije Milosevic wrote:
> |Gentle ping, requiring someone to push the change. :)|

Sure, I can do that, but please attach output of (git format-patch) as an 
attachment
to an email. The current email has a weird format I can directly apply with git 
am.

Cheers,
MartinFrom 9d7646428bf36449cde380230bcc20fa835857dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dimitrije=20Milo=C5=A1evi=C4=87?=
 
Date: Fri, 29 Jul 2022 08:36:06 +0200
Subject: [PATCH] libsanitizer: Cherry-pick 2bfb0fcb51510f22723c8cdfefe from
 upstream

2bfb0fcb51510f22723c8cdfefe [Sanitizer][MIPS] Fix stat struct size for the O32 ABI.

Signed-off-by: Dimitrije Milosevic .

---
 .../sanitizer_common/sanitizer_platform_limits_posix.h | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
index 89772a7e5c0..75c6cc7f285 100644
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -81,9 +81,10 @@ const unsigned struct_kernel_stat64_sz = 104;
 const unsigned struct_kernel_stat_sz = 144;
 const unsigned struct_kernel_stat64_sz = 104;
 #elif defined(__mips__)
-const unsigned struct_kernel_stat_sz = SANITIZER_ANDROID
-   ? FIRST_32_SECOND_64(104, 128)
-   : FIRST_32_SECOND_64(144, 216);
+const unsigned struct_kernel_stat_sz =
+SANITIZER_ANDROID
+? FIRST_32_SECOND_64(104, 128)
+: FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 160 : 144, 216);
 const unsigned struct_kernel_stat64_sz = 104;
 #elif defined(__s390__) && !defined(__s390x__)
 const unsigned struct_kernel_stat_sz = 64;
-- 
2.25.1



Re: [PATCH] libsanitizer: Cherry-pick 2bfb0fcb51510f22723c8cdfefe from upstream

2022-07-28 Thread Martin Liška
On 7/28/22 15:43, Dimitrije Milosevic wrote:
> |Gentle ping, requiring someone to push the change. :)|

Sure, I can do that, but please attach output of (git format-patch) as an 
attachment
to an email. The current email has a weird format I can directly apply with git 
am.

Cheers,
Martin


Re: [PATCH] libsanitizer: Cherry-pick 2bfb0fcb51510f22723c8cdfefe from upstream

2022-07-28 Thread Dimitrije Milosevic
Gentle ping, requiring someone to push the change. :)

From: Dimitrije Milosevic
Sent: Monday, July 25, 2022 8:55 AM
To: gcc-patches@gcc.gnu.org 
Cc: Djordje Todorovic ; xry...@xry111.site 

Subject: [PATCH] libsanitizer: Cherry-pick 2bfb0fcb51510f22723c8cdfefe from 
upstream 
 
2bfb0fcb51510f22723c8cdfefe [Sanitizer][MIPS] Fix stat struct size for the O32 
ABI.

Signed-off-by: Dimitrije Milosevic .

---
 .../sanitizer_common/sanitizer_platform_limits_posix.h | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h 
b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
index 89772a7e5c0..75c6cc7f285 100644
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -81,9 +81,10 @@ const unsigned struct_kernel_stat64_sz = 104;
 const unsigned struct_kernel_stat_sz = 144;
 const unsigned struct_kernel_stat64_sz = 104;
 #elif defined(__mips__)
-const unsigned struct_kernel_stat_sz = SANITIZER_ANDROID
-   ? FIRST_32_SECOND_64(104, 128)
-   : FIRST_32_SECOND_64(144, 216);
+const unsigned struct_kernel_stat_sz =
+    SANITIZER_ANDROID
+    ? FIRST_32_SECOND_64(104, 128)
+    : FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 160 : 144, 216);
 const unsigned struct_kernel_stat64_sz = 104;
 #elif defined(__s390__) && !defined(__s390x__)
 const unsigned struct_kernel_stat_sz = 64;
-- 
2.25.1

Re: [PATCH] libsanitizer: Cherry-pick 2bfb0fcb51510f22723c8cdfefe from upstream

2022-07-25 Thread Xi Ruoyao via Gcc-patches
LGTM.  Requiring permission to push.

> +const unsigned struct_kernel_stat_sz =
> +    SANITIZER_ANDROID
> +    ? FIRST_32_SECOND_64(104, 128)
> +    : FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 160 : 144, 216);

These values matches sizeof(struct stat) on gcc230, so should be
correct:

xry111@gcc230:~$ cat t.c
#include 
#include 

int main()
{
  printf("%d\n", sizeof(struct stat));
}
xry111@gcc230:~$ cc t.c -mabi=32 && ./a.out 
144
xry111@gcc230:~$ cc t.c -mabi=n32 && ./a.out 
160
xry111@gcc230:~$ cc t.c -mabi=64 && ./a.out 
216

-- 
Xi Ruoyao 
School of Aerospace Science and Technology, Xidian University