This is an archive of the discontinued LLVM Phabricator instance.

[MIPS][AddressSanitizer] Resolve build issues for the n32 ABI
ClosedPublic

Authored by dmilosevic141 on Jun 6 2022, 3:58 AM.

Details

Summary

Building the compiler-rt's AddressSanitizer for the n32 MIPS ABI currently fails, due to a few reasons:

  • defined(__mips64), which is set solely based on the architecture type (32-bit/64-bit), was still used in some places. Therefore, defined(__mips64) is swapped with SANITIZER_MIPS64, which takes the ABI into account as well - defined(__mips64) && _MIPS_SIM == ABI64.
  • The n32 ABI still uses 64-bit *Linux* system calls, even though the word size is 32 bits.
  • After the transition to canonical system calls (D124212), the n32 ABI still didn't use them, even though they are supported, as per https://github.com/torvalds/linux/blob/master/arch/mips/kernel/syscalls/syscall_n32.tbl.

Diff Detail

Event Timeline

dmilosevic141 created this revision.Jun 6 2022, 3:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2022, 3:58 AM
dmilosevic141 requested review of this revision.Jun 6 2022, 3:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2022, 3:58 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript

I've changed the following:

  • Rebased.
  • Made sure MIPS is targeted before checking its ABI.
dmilosevic141 edited the summary of this revision. (Show Details)Jun 6 2022, 11:20 PM
This revision is now accepted and ready to land.Jun 23 2022, 8:04 AM
This revision was landed with ongoing or failed builds.Jul 6 2022, 3:45 AM
This revision was automatically updated to reflect the committed changes.