* [ia64] [patch] Support recent libunwind-ia64.so.8 (1.0.1+)
@ 2012-03-03 21:18 Jan Kratochvil
2012-03-05 16:26 ` Joel Brobecker
2012-03-05 17:01 ` Pedro Alves
0 siblings, 2 replies; 4+ messages in thread
From: Jan Kratochvil @ 2012-03-03 21:18 UTC (permalink / raw)
To: gdb-patches
Hi,
libunwind.so - GDB used it before, I have changed it in 2007 to .so.7 as .so
is only link-time name while .so.7 is its runtime DT_SONAME.
libunwind.so.7 - it was always available but it no longer is since 2011-09.
libunwind.so.8 - it is a new major version since libunwind-1.0.1:
http://lists.nongnu.org/archive/html/libunwind-devel/2011-09/msg00031.html
libunwind.so.7 is no longer distributed.
I have asked about reverting back to libunwind.so.7 bit it was declined:
http://lists.nongnu.org/archive/html/libunwind-devel/2012-02/msg00017.html
As there are already both libunwind.so.8 and libunwind.so.7 stable builds out
there proposing the patch below.
Thanks,
Jan
gdb/
2012-03-03 Jan Kratochvil <jan.kratochvil@redhat.com>
* libunwind-frame.c (LIBUNWIND_SO): Change .7 to .8.
[!LIBUNWIND_SO] (LIBUNWIND_SO_7): New #define.
(libunwind_load): New variable so_error, use it for dlerror. Try to
load also LIBUNWIND_SO_7.
--- a/gdb/libunwind-frame.c
+++ b/gdb/libunwind-frame.c
@@ -95,7 +95,11 @@ struct libunwind_frame_cache
#ifndef LIBUNWIND_SO
/* Use the stable ABI major version number. `libunwind-ia64.so' is a link time
only library, not a runtime one. */
-#define LIBUNWIND_SO "libunwind-" STRINGIFY(UNW_TARGET) ".so.7"
+#define LIBUNWIND_SO "libunwind-" STRINGIFY(UNW_TARGET) ".so.8"
+
+/* Provide also compatibility with older .so. The two APIs are compatible, .8
+ is only extended a bit, GDB does not use the extended API at all. */
+#define LIBUNWIND_SO_7 "libunwind-" STRINGIFY(UNW_TARGET) ".so.7"
#endif
static char *get_reg_name = STRINGIFY(UNW_OBJ(get_reg));
@@ -513,14 +517,28 @@ static int
libunwind_load (void)
{
void *handle;
+ char *so_error = NULL;
handle = dlopen (LIBUNWIND_SO, RTLD_NOW);
if (handle == NULL)
{
+ so_error = xstrdup (dlerror ());
+#ifdef LIBUNWIND_SO_7
+ handle = dlopen (LIBUNWIND_SO_7, RTLD_NOW);
+#endif /* LIBUNWIND_SO_7 */
+ }
+ if (handle == NULL)
+ {
fprintf_unfiltered (gdb_stderr, _("[GDB failed to load %s: %s]\n"),
- LIBUNWIND_SO, dlerror ());
- return 0;
+ LIBUNWIND_SO, so_error);
+#ifdef LIBUNWIND_SO_7
+ fprintf_unfiltered (gdb_stderr, _("[GDB failed to load %s: %s]\n"),
+ LIBUNWIND_SO_7, dlerror ());
+#endif /* LIBUNWIND_SO_7 */
}
+ xfree (so_error);
+ if (handle == NULL)
+ return 0;
/* Initialize pointers to the dynamic library functions we will use. */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [ia64] [patch] Support recent libunwind-ia64.so.8 (1.0.1+)
2012-03-03 21:18 [ia64] [patch] Support recent libunwind-ia64.so.8 (1.0.1+) Jan Kratochvil
@ 2012-03-05 16:26 ` Joel Brobecker
2012-03-05 17:13 ` [commit] " Jan Kratochvil
2012-03-05 17:01 ` Pedro Alves
1 sibling, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2012-03-05 16:26 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb-patches
On Sat, Mar 03, 2012 at 10:18:15PM +0100, Jan Kratochvil wrote:
> gdb/
> 2012-03-03 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> * libunwind-frame.c (LIBUNWIND_SO): Change .7 to .8.
> [!LIBUNWIND_SO] (LIBUNWIND_SO_7): New #define.
> (libunwind_load): New variable so_error, use it for dlerror. Try to
> load also LIBUNWIND_SO_7.
FWIW, seems reasonable to me. My understanding is that the interfaces
are compatible, at least for our purposes...
--
Joel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [ia64] [patch] Support recent libunwind-ia64.so.8 (1.0.1+)
2012-03-03 21:18 [ia64] [patch] Support recent libunwind-ia64.so.8 (1.0.1+) Jan Kratochvil
2012-03-05 16:26 ` Joel Brobecker
@ 2012-03-05 17:01 ` Pedro Alves
1 sibling, 0 replies; 4+ messages in thread
From: Pedro Alves @ 2012-03-05 17:01 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb-patches
On 03/03/2012 09:18 PM, Jan Kratochvil wrote:> 2012-03-03 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> * libunwind-frame.c (LIBUNWIND_SO): Change .7 to .8.
> [!LIBUNWIND_SO] (LIBUNWIND_SO_7): New #define.
> (libunwind_load): New variable so_error, use it for dlerror. Try to
> load also LIBUNWIND_SO_7.
Looks fine to me, too.
--
Pedro Alves
^ permalink raw reply [flat|nested] 4+ messages in thread
* [commit] [ia64] [patch] Support recent libunwind-ia64.so.8 (1.0.1+)
2012-03-05 16:26 ` Joel Brobecker
@ 2012-03-05 17:13 ` Jan Kratochvil
0 siblings, 0 replies; 4+ messages in thread
From: Jan Kratochvil @ 2012-03-05 17:13 UTC (permalink / raw)
To: Joel Brobecker, Pedro Alves; +Cc: gdb-patches
On Mon, 05 Mar 2012 17:26:21 +0100, Joel Brobecker wrote:
> On Sat, Mar 03, 2012 at 10:18:15PM +0100, Jan Kratochvil wrote:
> > * libunwind-frame.c (LIBUNWIND_SO): Change .7 to .8.
> > [!LIBUNWIND_SO] (LIBUNWIND_SO_7): New #define.
> > (libunwind_load): New variable so_error, use it for dlerror. Try to
> > load also LIBUNWIND_SO_7.
>
> FWIW, seems reasonable to me. My understanding is that the interfaces
> are compatible, at least for our purposes...
On Mon, 05 Mar 2012 18:01:39 +0100, Pedro Alves wrote:
> Looks fine to me, too.
Checked in:
http://sourceware.org/ml/gdb-cvs/2012-03/msg00099.html
Thanks,
Jan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-03-05 17:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-03 21:18 [ia64] [patch] Support recent libunwind-ia64.so.8 (1.0.1+) Jan Kratochvil
2012-03-05 16:26 ` Joel Brobecker
2012-03-05 17:13 ` [commit] " Jan Kratochvil
2012-03-05 17:01 ` Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox