diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp --- a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp +++ b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp @@ -21,6 +21,7 @@ #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Twine.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/CrashRecoveryContext.h" #include "llvm/Support/Error.h" #include "llvm/Support/FileSystem.h" @@ -38,16 +39,13 @@ #include #include -#ifdef __GLIBC__ -#if __GLIBC_MINOR__ >= 35 -#define GLIBC_INITS_RSEQ -#endif // __GLIBC__MINOR > 35 -#endif // __GLIBC__ - -#ifdef GLIBC_INITS_RSEQ +#if defined(__GLIBC__) && __has_include() #include -#endif // HAS_RSEQ -#endif // __linux__ +#ifdef RSEQ_SIG +#define GLIBC_INITS_RSEQ +#endif +#endif +#endif namespace llvm { namespace exegesis {