[ltrace] Fix demangler resolution - Resolves: #631069 FTBFS

Petr Machata pmachata at fedoraproject.org
Wed Sep 8 14:12:14 UTC 2010


commit 90355445c9231d85175108eac2c71d3b78bd8561
Author: Petr Machata <pmachata at redhat.com>
Date:   Wed Sep 8 16:12:05 2010 +0200

    Fix demangler resolution
    - Resolves: #631069 FTBFS

 .gitignore                |    1 +
 ltrace-0.5-demangle.patch |   58 +++++++++++++++++++++++++++++++++++++++++++++
 ltrace.spec               |   14 ++++++++++-
 3 files changed, 72 insertions(+), 1 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index c63f4ee..94e6d6c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 ltrace-0.5-svn45.tar.gz
+ltrace-*/
diff --git a/ltrace-0.5-demangle.patch b/ltrace-0.5-demangle.patch
new file mode 100644
index 0000000..61085f4
--- /dev/null
+++ b/ltrace-0.5-demangle.patch
@@ -0,0 +1,58 @@
+diff -urp ltrace-0.5/configure.ac ltrace-0.5-pm/configure.ac
+--- ltrace-0.5/configure.ac	2006-06-14 06:55:21.000000000 +0200
++++ ltrace-0.5-pm/configure.ac	2010-09-08 14:56:29.000000000 +0200
+@@ -16,6 +16,7 @@ AC_PROG_INSTALL
+ dnl Checks for libraries.
+ AC_CHECK_LIB(iberty, cplus_demangle,,,)
+ AC_CHECK_LIB(supc++, __cxa_demangle,,,)
++AC_CHECK_LIB(stdc++, __cxa_demangle,,,)
+ 
+ dnl
+ dnl The following stuff may be useful, but I don't use it now.
+diff -urp ltrace-0.5/demangle.c ltrace-0.5-pm/demangle.c
+--- ltrace-0.5/demangle.c	2006-02-20 22:48:07.000000000 +0100
++++ ltrace-0.5-pm/demangle.c	2010-09-08 15:06:23.000000000 +0200
+@@ -9,6 +9,7 @@
+ #include "options.h"
+ #include "output.h"
+ #include "demangle.h"
++#include "ltrace.h"
+ 
+ #include "dict.h"
+ 
+diff -up ltrace-0.5/demangle.c\~ ltrace-0.5/demangle.c
+--- ltrace-0.5/demangle.c~	2006-02-20 22:48:07.000000000 +0100
++++ ltrace-0.5/demangle.c	2010-09-08 15:21:44.000000000 +0200
+@@ -28,7 +28,7 @@ static void my_demangle_dict_clear(void)
+ const char *my_demangle(const char *function_name)
+ {
+ 	const char *tmp, *fn_copy;
+-#if !defined HAVE_LIBIBERTY && defined HAVE_LIBSUPC__
++#ifdef USE_CXA_DEMANGLE
+ 	extern char *__cxa_demangle(const char *, char *, size_t *, int *);
+ 	int status = 0;
+ #endif
+@@ -42,7 +42,7 @@ const char *my_demangle(const char *func
+ 		fn_copy = strdup(function_name);
+ #ifdef HAVE_LIBIBERTY
+ 		tmp = cplus_demangle(function_name, DMGL_ANSI | DMGL_PARAMS);
+-#elif defined HAVE_LIBSUPC__
++#elif defined USE_CXA_DEMANGLE
+ 		tmp = __cxa_demangle(function_name, NULL, NULL, &status);
+ #endif
+ 		if (!tmp)
+diff -up ltrace-0.5/ltrace.h\~ ltrace-0.5/ltrace.h
+--- ltrace-0.5/ltrace.h~	2010-09-08 15:30:25.000000000 +0200
++++ ltrace-0.5/ltrace.h	2010-09-08 15:38:27.000000000 +0200
+@@ -14,7 +14,10 @@
+ #define MAX_LIBRARY	30
+ #define TRACE_FORK	1
+ 
+-#if defined HAVE_LIBIBERTY || defined HAVE_LIBSUPC__
++#if defined HAVE_LIBSUPC__ || defined HAVE_LIBSTDC__
++# define USE_CXA_DEMANGLE
++#endif
++#if defined HAVE_LIBIBERTY || defined USE_CXA_DEMANGLE
+ # define USE_DEMANGLE
+ #endif
+ 
diff --git a/ltrace.spec b/ltrace.spec
index 97d31c0..ab5ad15 100644
--- a/ltrace.spec
+++ b/ltrace.spec
@@ -1,13 +1,14 @@
 Summary: Tracks runtime library calls from dynamically linked executables
 Name: ltrace
 Version: 0.5
-Release: 16.45svn%{?dist}
+Release: 17.45svn%{?dist}
 URL: http://ltrace.alioth.debian.org/
 License: GPLv2+
 Group: Development/Debuggers
 ExclusiveArch: %{ix86} x86_64 ia64 ppc ppc64 s390 s390x alpha sparc
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: elfutils-libelf-devel dejagnu
+BuildRequires: autoconf automake
 
 # Tarball generated from svn checkout.  To regenerate:
 # svn co svn://svn.debian.org/ltrace -r 45
@@ -36,6 +37,7 @@ Patch18: ltrace-0.5-s390-31-on-64.patch
 Patch19: ltrace-0.5-fork-ppc64.patch
 Patch20: ltrace-0.5-exec-stripped.patch
 Patch21: ltrace-0.5-ppc-plt-glink.patch
+Patch22: ltrace-0.5-demangle.patch
 
 %description
 Ltrace is a debugging program which runs a specified command until the
@@ -71,12 +73,15 @@ execution of processes.
 %patch19 -p1
 %patch20 -p1
 %patch21 -p1
+%patch22 -p1
 sed -i -e 's/-o root -g root//' Makefile.in
 
 %build
 # This ugly hack is necessary to build and link files for correct
 # architecture.  It makes a difference on ppc.
 export CC="gcc`echo $RPM_OPT_FLAGS | sed -n 's/^.*\(-m[36][124]\).*$/ \1/p'` -D_LARGEFILE64_SOURCE"
+# We touch configure.ac up there
+autoreconf -i
 %configure CC="$CC"
 make %{?_smp_mflags}
 
@@ -102,6 +107,13 @@ rm -rf $RPM_BUILD_ROOT
 %config(noreplace) %{_sysconfdir}/ltrace.conf
 
 %changelog
+* Wed Sep  8 2010 Petr Machata <pmachata at redhat.com> - 0.5-17.45svn
+- Fix demangler resolution.  Libiberty is not in the default install
+  anymore, and the fallback configure check for __cxa_demangle doesn't
+  take into account the possibility that the symbol might be in
+  libstdc++ instead.
+- Resolves: #631069 FTBFS
+
 * Wed May 19 2010 Petr Machata <pmachata at redhat.com> - 0.5-16.45svn.1
 - When the value of undefined symbol in PPC 32-bit binary is 0, use
   PPC-specific magic to compute the PLT slots.


More information about the scm-commits mailing list