Hi,
The usage of SYS_rseq in llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp might not be ok when compiling with gcc >= 10, glibc >= 2.35 but rather old kernel headers (< 4.18). It's not common, but it happened to me:
[2023-08-05T02:06:18.024Z] /workdir/src/llvm-17.0.0/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp: In member function 'void llvm::exegesis::{anonymous}::SubProcessFunctionExecutorImpl::prepareAndRunBenchmark(int, const llvm::exegesis::BenchmarkKey&) const':
[2023-08-05T02:06:18.025Z] /workdir/src/llvm-17.0.0/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp:361:17: error: 'SYS_rseq' was not declared in this scope
[2023-08-05T02:06:18.025Z] 361 | syscall(SYS_rseq, (intptr_t)__builtin_thread_pointer() + __rseq_offset,
[2023-08-05T02:06:18.025Z] | ^~~~~~~~
I guess the preprocessor directive guarding this shall be modified to read:
-#ifdef GLIBC_INITS_RSEQ
+#if defined(GLIBC_INITS_RSEQ) && defined(SYS_rseq)
Cheers,
Romain
Hi,
The usage of
SYS_rseqinllvm/tools/llvm-exegesis/lib/BenchmarkRunner.cppmight not be ok when compiling with gcc >= 10, glibc >= 2.35 but rather old kernel headers (< 4.18). It's not common, but it happened to me:I guess the preprocessor directive guarding this shall be modified to read:
Cheers,
Romain