public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/105614] New: mips64: sanitizer_platform_limits_linux.cpp:75:38: error: static assertion failed
@ 2022-05-16  8:53 judge.packham at gmail dot com
  2022-05-16  9:04 ` [Bug sanitizer/105614] " marxin at gcc dot gnu.org
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: judge.packham at gmail dot com @ 2022-05-16  8:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105614

            Bug ID: 105614
           Summary: mips64: sanitizer_platform_limits_linux.cpp:75:38:
                    error: static assertion failed
           Product: gcc
           Version: 11.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: judge.packham at gmail dot com
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at gcc dot gnu.org
  Target Milestone: ---

Building for mips64-unknown-linux-gnu with libsanitizer enabled the following
static_assert is triggered.

[ALL  ]    In file included from
/home/ctng/crosstool-ng/.build/mips64-unknown-linux-gnu/src/gcc/libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cpp:21: 
[ERROR]   
/home/ctng/crosstool-ng/.build/mips64-unknown-linux-gnu/src/gcc/libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cpp:75:38:
error: static assertion failed                                                  
[ALL  ]       75 | COMPILER_CHECK(struct_kernel_stat_sz == sizeof(struct
stat));                                                                         
[ALL  ]          |                ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~  
[ALL  ]   
/home/ctng/crosstool-ng/.build/mips64-unknown-linux-gnu/src/gcc/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:332:44:
note: in definition of macro 'COMPILER_CHECK'                                   
[ALL  ]      332 | #define COMPILER_CHECK(pred) static_assert(pred, "")         
[ALL  ]          |                                            ^~~~              
[ERROR]    make[5]: *** [Makefile:615: sanitizer_platform_limits_linux.lo]
Error 1                                                                         
[ERROR]    make[5]: *** Waiting for unfinished jobs....                         

Looking at the libsanitizer code I see 

#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_stat64_sz = 104;

But from the Linux kernel's arch/mips/include/uapi/asm/stat.h I make the size
of struct stat 104 for the _MIPS_SIM_ABI64 case. The 144 seems to line up with
the _MIPS_SIM_NABI32/_MIPS_SIM_ABI32 case.

Where did libsanitizer get 216 from?

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2023-07-06  1:00 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-16  8:53 [Bug sanitizer/105614] New: mips64: sanitizer_platform_limits_linux.cpp:75:38: error: static assertion failed judge.packham at gmail dot com
2022-05-16  9:04 ` [Bug sanitizer/105614] " marxin at gcc dot gnu.org
2022-05-16  9:26 ` judge.packham at gmail dot com
2022-05-16  9:28 ` judge.packham at gmail dot com
2022-05-16  9:29 ` marxin at gcc dot gnu.org
2022-05-17  4:04 ` judge.packham at gmail dot com
2022-05-17 12:22 ` marxin at gcc dot gnu.org
2022-05-20  0:10 ` hp at gcc dot gnu.org
2022-05-22  6:18 ` judge.packham at gmail dot com
2022-06-29 11:57 ` marxin at gcc dot gnu.org
2022-06-30  3:34 ` xry111 at gcc dot gnu.org
2022-06-30  3:55 ` xry111 at gcc dot gnu.org
2022-06-30  4:16 ` xry111 at gcc dot gnu.org
2022-06-30  5:07 ` judge.packham at gmail dot com
2022-06-30 10:05 ` xry111 at gcc dot gnu.org
2022-08-31  3:58 ` broly at mac dot com
2022-08-31  4:10 ` xry111 at gcc dot gnu.org
2022-08-31  4:19 ` broly at mac dot com
2022-11-20 17:30 ` broly at mac dot com
2023-05-03 18:41 ` broly at mac dot com
2023-05-03 18:54 ` broly at mac dot com
2023-07-05 15:59 ` syq at gcc dot gnu.org
2023-07-06  0:58 ` broly at mac dot com
2023-07-06  1:00 ` syq at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).