[llvm] [BOLT][RISCV] Implement basic instrumentation (PR #71664)

Job Noorman via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 10 01:20:57 PST 2023


================
@@ -0,0 +1,94 @@
+#ifndef LLVM_TOOLS_LLVM_BOLT_SYS_RISCV64
+#define LLVM_TOOLS_LLVM_BOLT_SYS_RISCV64
+
+#include <dirent.h>
----------------
mtvec wrote:

When cross-compiling, these headers come from the sysroot (not from the host) so this shouldn't be an issue. Or am I missing something?

By the way, I have been cross-compiling this while developing instrumentation. This is my workflow:
```
$ riscv64-linux-gnu-g++ -c -ffreestanding -fno-exceptions -fno-rtti -fno-stack-protector -fPIC $LLVM_SRC/bolt/runtime/instr.cpp -o instr.o -I $LLVM_BUILD/tools/bolt/bolt_rt-bins/
$ ar -crs $LLVM_BUILD/lib/libbolt_rt_instr-riscv64.a instr.o
$ $LLVM_BUILD/bin/llvm-bolt --instrument --runtime-instrumentation-lib=libbolt_rt_instr-riscv64.a ...
```

https://github.com/llvm/llvm-project/pull/71664


More information about the llvm-commits mailing list