Author: Dharanendiran <dharanendiran@timesys.com>
Date: Thu, 24 Sep 2026 13:44:21 +0530

Error:
In file included from i386_init.c:37:0:
libebl_PERF_FLAGS.h:38:28: fatal error: asm/perf_regs.h: No such file or directory
 # include <asm/perf_regs.h>

---
 backends/libebl_PERF_FLAGS.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/backends/libebl_PERF_FLAGS.h b/backends/libebl_PERF_FLAGS.h
index 07ffc38..3a81c3d 100644
--- a/backends/libebl_PERF_FLAGS.h
+++ b/backends/libebl_PERF_FLAGS.h
@@ -32,8 +32,9 @@
 #define _LIBEBL_PERF_FLAGS_H 1
 
 #if defined(__linux__)
+# include <linux/version.h>
 /* XXX Need to exclude __linux__ arches without perf_regs.h. */
-#if defined(__x86_64__) || defined(__i386__) || defined(__aarch64__) || defined(__arm__)
+#if defined(__x86_64__) || defined(__i386__) || ((defined(__aarch64__) || defined(__arm__)) && LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0))
 /* || defined(other_architecture)... */
 # include <asm/perf_regs.h>
 #endif
-- 
2.25.1

