How can I add asan support for AArch64 ILP32 abi?
I find a patch abandoned D40134 [asan] Add support for AArch64 ILP32 (llvm.org), but it is too old to work.
I build compiler-rt with options --target=aarch64_be-unknown-linux-gnu_ilp32
and -DCOMPILER_RT_BUILD_SANITIZERS=ON
, the compiler will report errors as follows:
llvm/compiler-rt/lib/sanitizer_common/sanitizer_syscall_linux_aarch64.inc:13:23: note: expanded from macro 'SYSCALL'
#define SYSCALL(name) __NR_ ## name
^
<scratch space>:207:1: note: expanded from here
__NR_ftruncate
^
llvm/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:507:27: error: use of undeclared identifier '__NR_renameat'
return internal_syscall(SYSCALL(renameat), AT_FDCWD, (uptr)oldpath, AT_FDCWD,
^
llvm/compiler-rt/lib/sanitizer_common/sanitizer_syscall_linux_aarch64.inc:13:23: note: expanded from macro 'SYSCALL'
#define SYSCALL(name) __NR_ ## name
^
<scratch space>:7:1: note: expanded from here
__NR_renameat
^
llvm/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:814:27: error: use of undeclared identifier '__NR_lseek'
return internal_syscall(SYSCALL(lseek), fd, offset, whence);
^
llvm/compiler-rt/lib/sanitizer_common/sanitizer_syscall_linux_aarch64.inc:13:23: note: expanded from macro 'SYSCALL'
#define SYSCALL(name) __NR_ ## name
^
<scratch space>:49:1: note: expanded from here
__NR_lseek
^
3 errors generated.
ninja: build stopped: subcommand failed.