[compiler-rt] Problem with asm/stat.h on openSUSE PPC64

Hi,

This I believe is a bug in kernel headers on openSUSE PPC64 but maybe there is some workaround.

compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_linux.cc

includes asm/stat.h which ends up with errors:

/usr/include/asm/stat.h:31:2: error: unknown type name ‘ino_t’
ino_t st_ino;
^
/usr/include/asm/stat.h:34:2: error: unknown type name ‘mode_t’
mode_t st_mode;
^
/usr/include/asm/stat.h:39:2: error: unknown type name ‘uid_t’
uid_t st_uid;
^
/usr/include/asm/stat.h:40:2: error: unknown type name ‘gid_t’
gid_t st_gid;
^
/usr/include/asm/stat.h:42:2: error: unknown type name ‘off_t’
off_t st_size;

This obviously means that headers are not sanitized for userspace usage. Any ideas for a workaround?

+eugenis
(we are dealing with it: primarily we are trying to get hold of some PPC machine to verify our fix)

I have a PPC64 machine handy and can test a patch.

FTR, this was fixed in r195442.