From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32578 invoked by alias); 3 Mar 2012 21:18:39 -0000 Received: (qmail 32570 invoked by uid 22791); 3 Mar 2012 21:18:38 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 03 Mar 2012 21:18:20 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q23LIK9u003724 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 3 Mar 2012 16:18:20 -0500 Received: from host2.jankratochvil.net (ovpn-116-19.ams2.redhat.com [10.36.116.19]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q23LIGkF005653 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Sat, 3 Mar 2012 16:18:19 -0500 Date: Sat, 03 Mar 2012 21:18:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [ia64] [patch] Support recent libunwind-ia64.so.8 (1.0.1+) Message-ID: <20120303211815.GA6417@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-03/txt/msg00122.txt.bz2 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 * 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. */