summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--config.in3
-rwxr-xr-xconfigure201
-rw-r--r--configure.ac21
-rw-r--r--translate.cxx14
5 files changed, 210 insertions, 36 deletions
diff --git a/ChangeLog b/ChangeLog
index c62f5415..07f000c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-12-31 Frank Ch. Eigler <fche@elastic.org>
+
+ * translate.cxx (dump_unwindsyms): Adapt to elfutils build-id
+ bug that was fixed in 0.138.
+ * configure.ac: Look for elfutils/version.h.
+ * config.in, configure: Regenerated.
+
2008-12-30 Dave Brolley <brolley@redhat.com>
PR9692
diff --git a/config.in b/config.in
index 0f5677e9..44b22917 100644
--- a/config.in
+++ b/config.in
@@ -9,6 +9,9 @@
/* Define to 1 if you have the <crash/defs.h> header file. */
#undef HAVE_CRASH_DEFS_H
+/* Define to 1 if you have the <elfutils/version.h> header file. */
+#undef HAVE_ELFUTILS_VERSION_H
+
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
diff --git a/configure b/configure
index c89cbfbb..ea305667 100755
--- a/configure
+++ b/configure
@@ -7351,16 +7351,189 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+if test $build_elfutils = yes; then
+ case "$with_elfutils" in
+ /*) elfutils_srcdir="$with_elfutils" ;;
+ *) elfutils_srcdir="../$with_elfutils" ;;
+ esac
+ { echo "$as_me:$LINENO: running ${elfutils_srcdir}/configure" >&5
+echo "$as_me: running ${elfutils_srcdir}/configure" >&6;}
+ # Our libdw.so's libebl will look in $ORIGIN/../lib/... but that
+ # $ORIGIN is where libdw.so resides, which is not where there is a ../lib.
+ # Note that $libdir might be using a quoted use of $exec_prefix or $prefix.
+ # So we must make sure to pass those settings to elfutils configure.
+ elfutils_rpath="-Wl,--enable-new-dtags,-rpath,${libdir}/${PACKAGE_NAME}"
+ here=`pwd`
+ (mkdir -p build-elfutils && cd build-elfutils &&
+ ${elfutils_srcdir}/configure --enable-libebl-subdir=${PACKAGE_NAME} \
+ --includedir="${here}/include-elfutils" \
+ --libdir="${here}/lib-elfutils" \
+ --exec-prefix="$exec_prefix" \
+ --prefix="$prefix" \
+ CFLAGS="${CFLAGS/-Wall/}" \
+ LDFLAGS="$LDFLAGS $elfutils_rpath" &&
+ make install-data # so that elfutils/version.h - if any - may be found.
+ )
+fi
+
+save_CPPFLAGS=${CPPFLAGS}
+CPPFLAGS="${CPPFLAGS} -Iinclude-elfutils" # in case bundled elfutils
+
+for ac_header in elfutils/version.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ------------------------------------------- ##
+## Report this to systemtap@sources.redhat.com ##
+## ------------------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+CPPFLAGS="$save_CPPFLAGS"
+
ac_config_headers="$ac_config_headers config.h:config.in"
ac_config_files="$ac_config_files Makefile doc/Makefile doc/SystemTap_Tapset_Reference/Makefile stap.1 stapprobes.5 stapfuncs.5 stapvars.5 stapex.5 staprun.8 stap-server.8 man/stapprobes.iosched.5 man/stapprobes.netdev.5 man/stapprobes.nfs.5 man/stapprobes.nfsd.5 man/stapprobes.pagefault.5 man/stapprobes.process.5 man/stapprobes.rpc.5 man/stapprobes.scsi.5 man/stapprobes.signal.5 man/stapprobes.socket.5 man/stapprobes.tcp.5 man/stapprobes.udp.5"
subdirs="$subdirs testsuite"
-
ac_config_files="$ac_config_files run-stap"
-
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
@@ -9007,30 +9180,6 @@ echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;}
fi
-if test $build_elfutils = yes; then
- case "$with_elfutils" in
- /*) elfutils_srcdir="$with_elfutils" ;;
- *) elfutils_srcdir="../$with_elfutils" ;;
- esac
- { echo "$as_me:$LINENO: running ${elfutils_srcdir}/configure" >&5
-echo "$as_me: running ${elfutils_srcdir}/configure" >&6;}
- # Our libdw.so's libebl will look in $ORIGIN/../lib/... but that
- # $ORIGIN is where libdw.so resides, which is not where there is a ../lib.
- # Note that $libdir might be using a quoted use of $exec_prefix or $prefix.
- # So we must make sure to pass those settings to elfutils configure.
- elfutils_rpath="-Wl,--enable-new-dtags,-rpath,${libdir}/${PACKAGE_NAME}"
- here=`pwd`
- (mkdir -p build-elfutils && cd build-elfutils &&
- ${elfutils_srcdir}/configure --enable-libebl-subdir=${PACKAGE_NAME} \
- --includedir="${here}/include-elfutils" \
- --libdir="${here}/lib-elfutils" \
- --exec-prefix="$exec_prefix" \
- --prefix="$prefix" \
- CFLAGS="${CFLAGS/-Wall/}" \
- LDFLAGS="$LDFLAGS $elfutils_rpath"
- )
-fi
-
if test "${prefix}" = "/usr/local"; then
{ echo "$as_me:$LINENO: " >&5
echo "$as_me: " >&6;}
diff --git a/configure.ac b/configure.ac
index 606da4a2..f979f8e4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -223,13 +223,6 @@ AC_LANG_PUSH(C++)
AC_CHECK_HEADERS([tr1/unordered_map])
AC_LANG_POP(C++)
-AC_CONFIG_HEADERS([config.h:config.in])
-AC_CONFIG_FILES(Makefile doc/Makefile doc/SystemTap_Tapset_Reference/Makefile stap.1 stapprobes.5 stapfuncs.5 stapvars.5 stapex.5 staprun.8 stap-server.8 man/stapprobes.iosched.5 man/stapprobes.netdev.5 man/stapprobes.nfs.5 man/stapprobes.nfsd.5 man/stapprobes.pagefault.5 man/stapprobes.process.5 man/stapprobes.rpc.5 man/stapprobes.scsi.5 man/stapprobes.signal.5 man/stapprobes.socket.5 man/stapprobes.tcp.5 man/stapprobes.udp.5)
-AC_CONFIG_SUBDIRS(testsuite)
-
-AC_CONFIG_FILES([run-stap], [chmod +x run-stap])
-
-AC_OUTPUT
if test $build_elfutils = yes; then
case "$with_elfutils" in
@@ -250,10 +243,22 @@ if test $build_elfutils = yes; then
--exec-prefix="$exec_prefix" \
--prefix="$prefix" \
CFLAGS="${CFLAGS/-Wall/}" \
- LDFLAGS="$LDFLAGS $elfutils_rpath"
+ LDFLAGS="$LDFLAGS $elfutils_rpath" &&
+ make install-data # so that elfutils/version.h - if any - may be found.
)
fi
+save_CPPFLAGS=${CPPFLAGS}
+CPPFLAGS="${CPPFLAGS} -Iinclude-elfutils" # in case bundled elfutils
+AC_CHECK_HEADERS([elfutils/version.h])
+CPPFLAGS="$save_CPPFLAGS"
+
+AC_CONFIG_HEADERS([config.h:config.in])
+AC_CONFIG_FILES(Makefile doc/Makefile doc/SystemTap_Tapset_Reference/Makefile stap.1 stapprobes.5 stapfuncs.5 stapvars.5 stapex.5 staprun.8 stap-server.8 man/stapprobes.iosched.5 man/stapprobes.netdev.5 man/stapprobes.nfs.5 man/stapprobes.nfsd.5 man/stapprobes.pagefault.5 man/stapprobes.process.5 man/stapprobes.rpc.5 man/stapprobes.scsi.5 man/stapprobes.signal.5 man/stapprobes.socket.5 man/stapprobes.tcp.5 man/stapprobes.udp.5)
+AC_CONFIG_SUBDIRS(testsuite)
+AC_CONFIG_FILES([run-stap], [chmod +x run-stap])
+AC_OUTPUT
+
if test "${prefix}" = "/usr/local"; then
AC_MSG_NOTICE([])
AC_MSG_NOTICE([For a private or temporary build of systemtap, we recommend])
diff --git a/translate.cxx b/translate.cxx
index cdc3da84..cce76db6 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -26,6 +26,9 @@
extern "C" {
#include <elfutils/libdwfl.h>
+#ifdef HAVE_ELFUTILS_VERSION_H
+#include <elfutils/version.h>
+#endif
}
using namespace std;
@@ -4475,8 +4478,15 @@ dump_unwindsyms (Dwfl_Module *m,
(const unsigned char **)&build_id_bits,
&build_id_vaddr)) > 0)
{
- /* XXX: But see https://bugzilla.redhat.com/show_bug.cgi?id=465872;
- dwfl_module_build_id was not intended to return the end address. */
+ // Enable workaround for elfutils dwfl bug.
+ // see https://bugzilla.redhat.com/show_bug.cgi?id=465872
+ // and http://sourceware.org/ml/systemtap/2008-q4/msg00579.html
+#ifdef _ELFUTILS_PREREQ
+#if _ELFUTILS_PREREQ(0,138)
+ // Let's standardize to the buggy "end of build-id bits" behavior.
+ build_id_vaddr += build_id_len;
+#endif
+#endif
if (c->session.verbose > 1) {
clog << "Found build-id in " << name
<< ", length " << build_id_len;