]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libdwfl/linux-pid-attach.c PR33974: __libdwfl_set_initial_registers_thread on non...
authorSerhei Makarov <serhei@serhei.io>
Fri, 13 Mar 2026 15:00:53 +0000 (11:00 -0400)
committerSerhei Makarov <serhei@serhei.io>
Fri, 13 Mar 2026 15:00:53 +0000 (11:00 -0400)
libdwfl_stacktrace uses __libdwfl_set_initial_registers_thread but it
is wrapped by #ifdef __linux__, causing build errors on non-Linux
platforms.

* linux-pid-attach.c (__libdwfl_set_initial_registers_thread): Unwrap
  from the #ifdef.

libdwfl/linux-pid-attach.c

index a6e4e41ad3f491df70514877779a3cd00eecbac6..aba6245033c66d5b7cda06e4ff44a3d544c35e70 100644 (file)
@@ -302,6 +302,8 @@ pid_getthread (Dwfl *dwfl __attribute__ ((unused)), pid_t tid,
   return true;
 }
 
+#endif /* __linux__ */
+
 /* Implement the ebl_set_initial_registers_tid setfunc callback.  */
 
 bool
@@ -327,6 +329,8 @@ __libdwfl_set_initial_registers_thread (int firstreg, unsigned nregs,
   return INTUSE(dwfl_thread_state_registers) (thread, firstreg, nregs, regs);
 }
 
+#ifdef __linux__
+
 static bool
 pid_set_initial_registers (Dwfl_Thread *thread, void *thread_arg)
 {
@@ -507,7 +511,9 @@ __libdwfl_get_pid_arg (Dwfl *dwfl)
   return NULL;
 }
 
-#else  /* __linux__ */
+#endif /* __linux__ */
+
+#ifndef __linux__
 
 bool
 internal_function