[Bug,general/32930] compile failure in i386_init.c asm/perf_regs.h: No such file or directory

Message ID bug-32930-10460-TXCjdYpczg@http.sourceware.org/bugzilla/
State Not applicable
Headers
Series [Bug,general/32930] compile failure in i386_init.c asm/perf_regs.h: No such file or directory |

Commit Message

mark at klomp dot org May 2, 2025, 7:51 p.m. UTC
  https://sourceware.org/bugzilla/show_bug.cgi?id=32930

Serhei Makarov <serhei at serhei dot io> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |serhei at serhei dot io

--- Comment #2 from Serhei Makarov <serhei at serhei dot io> ---
Should be fixable like this:


Going to check if any other places include a perf header without guarding by
architecture and submit a full patch.
  

Patch

diff --git a/backends/libebl_PERF_FLAGS.h b/backends/libebl_PERF_FLAGS.h
index 2ed45f0f..73bf2d45 100644
--- a/backends/libebl_PERF_FLAGS.h
+++ b/backends/libebl_PERF_FLAGS.h
@@ -32,8 +32,12 @@ 
 #define _LIBEBL_PERF_FLAGS_H 1

 #if defined(__linux__)
+/* XXX Need to exclude __linux__ arches without perf_regs.h. */
+#if defined(_ASM_X86_PERF_REGS_H)
+/* || defined(other_architecture)... */
 # include <asm/perf_regs.h>
 #endif
+#endif

 #if defined(_ASM_X86_PERF_REGS_H)
 /* See the code in x86_initreg_sample.c for list of required regs and