[PATCH] D66870: [Sanitizers] Add support for RISC-V 64-bit

Sam Elliott via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 18 03:04:15 PDT 2019


lenary added a comment.

I think I've found the error. Comment inline



================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:1980
+  ucontext_t *ucontext = (ucontext_t*)context;
+  *pc = ucontext->uc_mcontext.__gregs[REG_PC];
+  *bp = ucontext->uc_mcontext.__gregs[REG_S0];
----------------
I'm getting compiler errors around these accesses. My sysroot thinks that `__gregs` isn't a field in this struct, it thinks the field is `gregs` (It's pointing to `/opt/riscv-gcc-toolchain/sysroot/usr/include/bits/sigcontext.h:28:17` as the declaration for the `gregs` field.

I think this is the version of that file on github: https://github.com/riscv/riscv-glibc/blob/06983fe/sysdeps/unix/sysv/linux/riscv/bits/sigcontext.h#L27 (that git version matches the one used by https://github.com/riscv/riscv-gnu-toolchain)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66870/new/

https://reviews.llvm.org/D66870





More information about the llvm-commits mailing list