https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59009
--- Comment #52 from clyon at gcc dot gnu.org --- The patch I propose is broken, I missed the new warnings in my build log. I inserted #ifdef SYSCALL(chown32) before PRE_SYSCALL(chown16).... in sanitizer_common/sanitizer_common_syscalls.inc but the SYSCALL is not defined there, resulting in #if 0 like behaviour. I'm now wondering how can I get the information to know if #ifdef __NR_<xxx>uid32 i.e. which headers am I allowed to include here? Can I add #include <sys/syscall.h> or is it not desirable? Quoting Arnd: > To provide a little more background, uid16 support can be further limited to > these cases: > > * arm32 || x86-32 || sparc32 || sh || m68k > * libc5 || glibc-2.0 || glibc-2.1 || (glibc-2.2 to 2.15 built against > linux-2.2 kernel headers) > > or in other words, uid16 is never used > > * on 64-bit architectures > * on any glibc built against 2.4 or later kernel headers > * on glibc-2.16 or later (which drops support for linux-2.2) > > I don't know what the respective minimum libc and kernel versions are > for llvm and gcc, but it's possible that it could be dropped completely, > but if there is already a dependency on at least linux-2.3.39 and > glibc-2.2, the uid16 handling could just be removed. So if inluding <sys/syscall.h> is not OK in sanitizer_common/sanitizer_common_syscalls.inc and b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc (to avoid CHECK_TYPE_SIZE(__kernel_old_uid_t); CHECK_TYPE_SIZE(__kernel_old_gid_t); ) then it looks like the parts we want to #ifdef out should be removed instead.