[PATCH] AArch64 sanitizer support

Kostya Serebryany kcc at google.com
Tue Feb 11 02:34:20 PST 2014


On Tue, Feb 11, 2014 at 2:27 PM, Christophe Lyon <christophe.lyon at linaro.org
> wrote:

>
>
> ================
> Comment at: libsanitizer/sanitizer_common/sanitizer_linux.cc:96
> @@ -95,1 +95,3 @@
>  uptr internal_open(const char *filename, int flags) {
> +#ifdef __aarch64__
> +  return internal_syscall(__NR_openat, AT_FDCWD, (uptr)filename, flags);
> ----------------
> Kostya Serebryany wrote:
> > OMG, these ifdefs again...
> > What is so special about AArch64 that it needs other syscalls
> > (where ARM/PowerPC/SPARC/MIPS doesn't need them)?
> > If there is no way to avoid these ifdefs, they at least deserve a
> top-level comment in this file.
> >
> I discussed that a while ago with AArch64 maintainers, here is what they
> said:
>
> > The AArch64 linux port uses the canonical syscall set as mandated by
> > the upstream linux community for all new ports.  The system calls are
> > not missing, rather, other architectures are using legacy syscalls ;-)
>

Good to know. instead of using #ifdef __aarch64__ we can
use #if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
and define it in sanitizer_common/sanitizer_platform.h:

// The AArch64 linux port uses the canonical syscall set as mandated by
// the upstream linux community for all new ports. Other ports may still
// use legacy syscalls. <or something like this>
#ifndef SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
#ifdef __aarch64__
#define SANITIZER_USES_CANONICAL_LINUX_SYSCALLS 1
#else
#define SANITIZER_USES_CANONICAL_LINUX_SYSCALLS 0
#endif


>
>
> ================
> Comment at: libsanitizer/sanitizer_common/sanitizer_platform.h:80
> @@ -75,2 +79,3 @@
>  // but will consume more memory for TwoLevelByteMap.
> -#define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL <<
> 47)
> +#if defined(__aarch64__)
> +# define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL <<
> 39)
> ----------------
> Kostya Serebryany wrote:
> > (begging pardon for my ignorance)
> > Is __aarch64__ available in 32-bit mode? Or is it __arm__ then?
> > Why not just
> > #define SANITIZER_MMAP_RANGE_SIZE (1ULL << 39)
> > ?
> I think it depends :-)
> There is an ILP32 mode on AArch64 (which I haven't tested... oops).
>
ok

>
> But in fact the ARMv8 architectures supports two modes of operation:
> AArch64 and AArch32, both of which are supported by two different compilers
> (at least in GCC): aarch64-gcc and arm-XXX-gcc, where you want to use
> -march=armv8-a for instance.
>
>
> http://llvm-reviews.chandlerc.com/D2732
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140211/01a8c42e/attachment.html>


More information about the llvm-commits mailing list