<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57521>57521</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            compiler-rt on mips64el fails to build with `static assertion failed due to requirement 'struct_kernel_stat_sz == sizeof(stat)':
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            compiler-rt,
            backend:MIPS,
            build-problem
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          sylvestre
      </td>
    </tr>
</table>

<pre>
    With 15 rc3:
```
"/home/sylvestre/llvm-toolchain-15-15.0.0~+rc3/build-llvm/./bin/clang++" --target=mipsel-unknown-linux-gnu -DHAVE_RPC_XDR_H=0 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I"/home/sylvestre/llvm-toolchain-15-15.0.0~+rc3/compiler-rt/lib/sanitizer_common/.." -I"/home/sylvestre/llvm-toolchain-15-15.0.0~+rc3/build-llvm/include" -fstack-protector-strong -Wformat -Werror=format-security -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -ffile-prefix-map=/home/sylvestre/llvm-toolchain-15-15.0.0~+rc3/build-llvm/runtimes/runtimes-bins=build-llvm/runtimes/runtimes-bins -ffile-prefix-map=/home/sylvestre/llvm-toolchain-15-15.0.0~+rc3/= -no-canonical-prefixes -Wall -std=c++14 -Wno-unused-parameter -O3 -DNDEBUG -mips32r2 -mabi=32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -nostdinc++ -Wno-format -fno-rtti -Wglobal-constructors -MD -MT compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.mipsel.dir/sanitizer_platform_limits_linux.cpp.o -MF compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.mipsel.dir/sanitizer_platform_limits_linux.cpp.o.d -o compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.mipsel.dir/sanitizer_platform_limits_linux.cpp.o -c '/home/sylvestre/llvm-toolchain-15-15.0.0~+rc3/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_linux.cpp'
/home/sylvestre/llvm-toolchain-15-15.0.0~+rc3/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_linux.cpp:67:1: error: static assertion failed due to requirement 'struct_kernel_stat_sz == sizeof(stat)': 
COMPILER_CHECK(struct_kernel_stat_sz == sizeof(struct stat));
^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sylvestre/llvm-toolchain-15-15.0.0~+rc3/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:352:30: note: expanded from macro 'COMPILER_CHECK'
#define COMPILER_CHECK(pred) static_assert(pred, "")
                             ^             ~~~~
1 error generated.

```

it was working with -14:
https://buildd.debian.org/status/package.php?p=llvm-toolchain-14&suite=sid
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzNV9tu2zgQ_Rr7RaBgyZfED35wHLsNtm4KO93um0CLtMwNRaoklUu_fs9IysVNuwjQdruGLInDIWfmzI3aWXE_-6TCIUrGkcuHveG8NzjvDea9yaC72mGa9tLVw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