Skip to content

Commit 8f90a5c

Browse files
committed
[llvm-exegesis] Guard __builtin_thread_pointer use with __has_builtin
While Clang targets have supported __builtin_thread_pointer for a very long time (e.g., 2007 for AArch32, 2015 for AArch64), for some GCC ports, the support is very new (11.0 for x86[1], while we need to support GCC 7), and many ports haven't implemented __builtin_thread_pointer yet (m68k, powerpc, etc). [1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96955
1 parent cd69b0c commit 8f90a5c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#include <sys/wait.h>
3939
#include <unistd.h>
4040

41-
#if defined(__GLIBC__) && __has_include(<sys/rseq.h>)
41+
#if defined(__GLIBC__) && __has_include(<sys/rseq.h>) && __has_builtin(__builtin_thread_pointer)
4242
#include <sys/rseq.h>
4343
#ifdef RSEQ_SIG
4444
#define GLIBC_INITS_RSEQ

0 commit comments

Comments
 (0)