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

Tobias Hieta via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Aug 10 00:09:35 PDT 2023


Author: Guillaume Chatelet
Date: 2023-08-10T09:05:06+02:00
New Revision: e69c715c39f05ed2d9ceedaf71feeb61e0c142ef

URL: https://github.com/llvm/llvm-project/commit/e69c715c39f05ed2d9ceedaf71feeb61e0c142ef
DIFF: https://github.com/llvm/llvm-project/commit/e69c715c39f05ed2d9ceedaf71feeb61e0c142ef.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

(cherry picked from commit f70e83af7a708a22fdde8c644ac5810223090cd4)

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-branch-commits mailing list