Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Mar 2022 20:20:34 +0000
From:      bugzilla-noreply@freebsd.org
To:        toolchain@FreeBSD.org
Subject:   [Bug 262706] Build on arm64 fails to find libclang_rt.asan-aarch64.a
Message-ID:  <bug-262706-29464-tZN9wrRySI@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-262706-29464@https.bugs.freebsd.org/bugzilla/>
References:  <bug-262706-29464@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D262706

Dimitry Andric <dim@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dim@FreeBSD.org

--- Comment #2 from Dimitry Andric <dim@FreeBSD.org> ---
Yep, upstream doesn't yet support aarch64 for the sanitizers. If I attempt =
to
build it on an aarch64 machine, I see:

/home/dim/src/main/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sa=
nitizer_linux.cpp:1811:23:
error: field has incomplete type 'struct _aarch64_ctx'
  struct _aarch64_ctx head;
                      ^
/home/dim/src/main/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sa=
nitizer_linux.cpp:1811:10:
note: forward declaration of '__sanitizer::_aarch64_ctx'
  struct _aarch64_ctx head;
         ^
/home/dim/src/main/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sa=
nitizer_linux.cpp:1817:35:
error: no member named '__reserved' in '__mcontext'
  u8 *aux =3D ucontext->uc_mcontext.__reserved;
            ~~~~~~~~~~~~~~~~~~~~~ ^
/home/dim/src/main/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sa=
nitizer_linux.cpp:1820:12:
error: member access into incomplete type '__sanitizer::_aarch64_ctx'
    if (ctx->size =3D=3D 0) break;
           ^
/home/dim/src/main/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sa=
nitizer_linux.cpp:1811:10:
note: forward declaration of '__sanitizer::_aarch64_ctx'
  struct _aarch64_ctx head;
         ^
/home/dim/src/main/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sa=
nitizer_linux.cpp:1821:12:
error: member access into incomplete type '__sanitizer::_aarch64_ctx'
    if (ctx->magic =3D=3D kEsrMagic) {
           ^
/home/dim/src/main/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sa=
nitizer_linux.cpp:1811:10:
note: forward declaration of '__sanitizer::_aarch64_ctx'
  struct _aarch64_ctx head;
         ^
/home/dim/src/main/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sa=
nitizer_linux.cpp:1825:15:
error: member access into incomplete type '__sanitizer::_aarch64_ctx'
    aux +=3D ctx->size;
              ^
/home/dim/src/main/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sa=
nitizer_linux.cpp:1811:10:
note: forward declaration of '__sanitizer::_aarch64_ctx'
  struct _aarch64_ctx head;
         ^
/home/dim/src/main/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sa=
nitizer_linux.cpp:2055:31:
error: no member named 'pc' in '__mcontext'
  *pc =3D ucontext->uc_mcontext.pc;
        ~~~~~~~~~~~~~~~~~~~~~ ^
/home/dim/src/main/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sa=
nitizer_linux.cpp:2056:31:
error: no member named 'regs' in '__mcontext'
  *bp =3D ucontext->uc_mcontext.regs[29];
        ~~~~~~~~~~~~~~~~~~~~~ ^
/home/dim/src/main/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sa=
nitizer_linux.cpp:2057:31:
error: no member named 'sp' in '__mcontext'
  *sp =3D ucontext->uc_mcontext.sp;
        ~~~~~~~~~~~~~~~~~~~~~ ^
8 errors generated.

`_aarch64_ctx` is a Linux-specific context struct from
/usr/include/aarch64-linux-gnu/asm/sigcontext.h:

/*
 * Header to be used at the beginning of structures extending the user
 * context. Such structures must be placed after the rt_sigframe on the sta=
ck
 * and be 16-byte aligned. The last structure must be a dummy one with the
 * magic and size set to 0.
 */
struct _aarch64_ctx {
        __u32 magic;
        __u32 size;
};

but obviously it doesn't exist in FreeBSD. Similarly, struct ucontext and
mcontext have different members, and aren't generally compatible.

I think the only way to get this implemented is to have somebody with aarch=
64
knowledge, who can attempt to fix them up and submit reviews upstream.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-262706-29464-tZN9wrRySI>