A fix for PR21476 is currently in compiler-rt as r223925 / 429de66ac351c8b1e9a1bdd9da4d2fe78c14df05
The same issue is breaking GCC trunk on AArch64 systems. __kernel_old_uid_t is not intended to be used in native 64-bit tasks. It's only used by compat (32-bit) applications running on 64-bit kernel (multi-lib setup).
From Will Deacon (ARM):
AArch64 tasks only have 32-bit UIDs, so the getuid syscall (174) operates only on 32-bit UIDs. I don't think glibc exposes a 16-bit wrapper, so I can't see the old_uid_t being used for native applications.
There are a number of syscalls with "16" suffix. Those are only applicable for 32-bit tasks. In ARMv8 case, it must be running in AArch32 mode. AArch64 (LP64 and ILP32) tasks will not use them (confirmed by Andrew Pinski (Cavium)). ILP32 will use standard syscalls.
All syscalls with "16" suffix are available if kernel is configured with CONFIG_COMPAT, which then enables CONFIG_HAVE_UID16.
To summarize, only 32-bit sanitizer needs to have those as 64-bit tasks don't use them.
I only tested it with GCC trunk on 3.12.0 kernel, and in QEMU (user-mode) with 3.17.0 headers. Will test build with Clang also.