[llvm] f70e83a - [llvm-exegesis] Don't try to use SYS_rseq if it's not defined.

Guillaume Chatelet via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 00:32:54 PDT 2023


Author: Guillaume Chatelet
Date: 2023-08-07T07:32:44Z
New Revision: f70e83af7a708a22fdde8c644ac5810223090cd4

URL: https://github.com/llvm/llvm-project/commit/f70e83af7a708a22fdde8c644ac5810223090cd4
DIFF: https://github.com/llvm/llvm-project/commit/f70e83af7a708a22fdde8c644ac5810223090cd4.diff

LOG: [llvm-exegesis] Don't try to use SYS_rseq if it's not defined.

When compiling against recent glibc (>= 2.35) but old kernel headers (< 4.18), `SYS_rseq` is not defined and thus llvm-exegesis fails to build. So also check that `SYS_rseq` is defined before trying to use it.

Fixes https://github.com/llvm/llvm-project/issues/64456

Reviewed By: MaskRay, gchatelet

Differential Revision: https://reviews.llvm.org/D157189

Added: 
    

Modified: 
    llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
index e429ea57b5b27f..96ac1ae998e465 100644
--- a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
+++ b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
@@ -41,7 +41,7 @@
 
 #if defined(__GLIBC__) && __has_include(<sys/rseq.h>) && defined(HAVE_BUILTIN_THREAD_POINTER)
 #include <sys/rseq.h>
-#ifdef RSEQ_SIG
+#if defined(RSEQ_SIG) && defined(SYS_rseq)
 #define GLIBC_INITS_RSEQ
 #endif
 #endif


        


More information about the llvm-commits mailing list