This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: Try to include libunwind-ia64.h in libunwind-frame.h

On Thu, 02 Feb 2012 17:32:39 +0100, Tristan Gingold wrote:
> Part of the issue is libunwind.h, which is not well designed for cross operation:
> Note that gdb doesn't define UNW_REMOTE_ONLY.  So clearly in my case a wrong header will be used.

[ BTW could you wrap mails to 78-80 chars per line? ]

> I propose to fix this issue with the following patch:

It still did not build for me as it expects libunwind.h installed which
cross-build of libunwind does not install.

OK this patch instead?

For the test with libunwind HEAD I had to patch .so.7 -> .so.8 in GDB, posted
	[Libunwind-devel] .so version bump .7 -> .8 [Re: libunwind 1.0.1]
and for cross-built libunwind I had to fix and post
	[Libunwind-devel] [patch] Fix undefined symbol: _Uelf64_valid_object

Tested only the cross-build + successful dlopen, not with real ia64 target,


2012-02-10  Jan Kratochvil  <>
	    Tristan Gingold  <>

	* (--with-libunwind=auto): Set enable_libunwind for
	either of libunwind.h or libunwind-ia64.h (if ia64* is the target).
	* configure: Regenerate.
	* libunwind-frame.h: Conditionalize the file for HAVE_LIBUNWIND and
	not HAVE_LIBUNWIND_H.  Include libunwind-ia64.h instead of libunwind.h
	if possible.

--- a/gdb/
+++ b/gdb/
@@ -349,8 +349,14 @@ AS_HELP_STRING([--with-libunwind], [use libunwind frame unwinding support]),
   *)    AC_MSG_ERROR(bad value ${withval} for GDB with-libunwind option) ;;
   AC_CHECK_HEADERS(libunwind.h libunwind-ia64.h)
-  if test x"$ac_cv_header_libunwind_h" = xyes -a x"$ac_cv_header_libunwind_ia64_h" = xyes; then
+  if test x"$ac_cv_header_libunwind_h" = xyes; then
+  elif test x"$ac_cv_header_libunwind_ia64_h" = xyes; then
+    case "$target" in
+      ia64*)
+	enable_libunwind=yes;
+	;;
+    esac
--- a/gdb/libunwind-frame.h
+++ b/gdb/libunwind-frame.h
@@ -19,7 +19,7 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <>.  */
 struct frame_info;
 struct frame_id;
@@ -29,7 +29,13 @@ struct gdbarch;
-#include "libunwind.h"
+#if defined HAVE_LIBUNWIND_IA64_H
+# include "libunwind-ia64.h"
+#elif defined HAVE_LIBUNWIND_H
+# include "libunwind.h"
 struct libunwind_descr
@@ -73,4 +79,4 @@ int libunwind_get_reg_special (struct gdbarch *gdbarch,
 #endif /* libunwind-frame.h */
-#endif /* HAVE_LIBUNWIND_H  */
+#endif /* HAVE_LIBUNWIND */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]