Skip to content

llvm-exegesis doesn't build when using gcc >= 10, glibc >= 2.35 but kernel headers < 4.18 #64456

@Romain-Geissler-1A

Description

@Romain-Geissler-1A

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions