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

Andreas Schwab via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 18 05:08:55 PDT 2019


schwab marked an inline comment as done.
schwab added inline comments.


================
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];
----------------
lenary wrote:
> 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)
Don't use the obsolete riscv-glibc.  The official glibc sources are on sourceware.org.


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