LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Compile dbus with backtrace support (http://www.linuxquestions.org/questions/slackware-14/compile-dbus-with-backtrace-support-4175459330/)

Woodsman 04-23-2013 02:52 PM

Compile dbus with backtrace support
 
I'm trying to build a dbus package that provides backtrace support. According to this error message, I need to add the -rdynamic option to the build configuration:

"D-Bus not built with -rdynamic so unable to print a backtrace"

I made the following change to the slackbuild:

CFLAGS="$SLKCFLAGS -rdynamic"

Per the configure script, I also tried this:

CFLAGS="$SLKCFLAGS -export-dynamic"

What is the correct way to build dbus with backtrace support?

Thanks. :)

tuxbg 04-23-2013 04:00 PM

Quote:

Originally Posted by Woodsman (Post 4937437)
I'm trying to build a dbus package that provides backtrace support. According to this error message, I need to add the -rdynamic option to the build configuration:

"D-Bus not built with -rdynamic so unable to print a backtrace"

I made the following change to the slackbuild:

CFLAGS="$SLKCFLAGS -rdynamic"

Per the configure script, I also tried this:

CFLAGS="$SLKCFLAGS -export-dynamic"

What is the correct way to build dbus with backtrace support?

Thanks. :)

Code:

This is from --configure --help
Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE      do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --disable-maintainer-mode  disable make rules and dependencies not useful
                          (and sometimes confusing) to the casual installer
  --enable-silent-rules          less verbose build output (undo: `make V=1')
  --disable-silent-rules        verbose build output (undo: `make V=0')
  --disable-dependency-tracking  speeds up one-time build
  --enable-dependency-tracking  do not reject slow dependency extractors
  --enable-shared[=PKGS]  build shared libraries [default=yes]
  --enable-static[=PKGS]  build static libraries [default=yes]
  --enable-fast-install[=PKGS]
                          optimize for fast installation [default=yes]
  --disable-libtool-lock  avoid locking (might break parallel builds)
  --enable-compiler-coverage
                          Enable generation of coverage data
  --disable-compiler-optimisations
                          Disable compiler optimisations
  --enable-developer      set defaults to be appropriate for a D-Bus developer
                          instead of a distribution/end-user
  --enable-ansi          enable -ansi -pedantic gcc flags
  --enable-verbose-mode  support verbose debug mode
  --enable-asserts        include assertion checks
  --enable-checks        include sanity checks on public API
  --enable-xml-docs      build XML documentation (requires xmlto)
  --enable-doxygen-docs  build DOXYGEN documentation (requires Doxygen)
  --enable-abstract-sockets
                          use abstract socket namespace (linux only)
  --enable-selinux        build with SELinux support
  --enable-libaudit      build audit daemon support for SELinux
  --enable-dnotify        build with dnotify support (linux only)
  --enable-inotify        build with inotify support (linux only)
  --enable-kqueue        build with kqueue support
  --enable-console-owner-file
                          enable console owner file
  --enable-userdb-cache  build with userdb-cache support
  --enable-launchd        build with launchd auto-launch support
  --enable-systemd        build with systemd at_console support
  --enable-embedded-tests enable unit test code in the library and binaries
  --enable-modular-tests  enable modular regression tests (requires GLib)
  --enable-tests          enable/disable all tests, overriding
                          embedded-tests/modular-tests
  --enable-installed-tests
                          enable unit test code in the library and binaries
  --enable-epoll          use epoll(4) on Linux
  --enable-x11-autolaunch build with X11 auto-launch support
  --disable-Werror        compile without -Werror (normally enabled in
                          development builds)
  --enable-stats          enable bus daemon usage statistics

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE      do not use PACKAGE (same as --with-PACKAGE=no)
  --with-pic[=PKGS]      try to use only PIC/non-PIC objects [default=use
                          both]
  --with-gnu-ld          assume the C compiler uses GNU ld [default=no]
  --with-sysroot=DIR Search for dependent libraries within DIR
                        (or the compiler's sysroot if not specified).
  --with-xml=libxml/expat XML library to use (libxml may be named libxml2 on
                          some systems)
  --with-init-scripts=redhat
                          Style of init scripts to install
  --with-session-socket-dir=dirname
                          Where to put sockets for the per-login-session
                          message bus
  --with-test-socket-dir=dirname
                          Where to put sockets for make check
  --with-system-pid-file=pidfile
                          PID file for systemwide daemon
  --with-system-socket=filename
                          UNIX domain socket for systemwide daemon
  --with-console-auth-dir=dirname
                          directory to check for console ownerhip
  --with-console-owner-file=filename
                          file whose owner determines current console owner
  --with-launchd-agent-dir=dirname
                          directory to put the launchd agent (default:
                          /Library/LaunchAgents)
  --with-dbus-user=<user> User for running the DBUS daemon (messagebus)
  --with-dbus-daemondir=dirname
                          Directory for installing the DBUS daemon
  --with-dbus-session-bus-default-address=nonce-tcp:/autolaunch:/tcp:host:port
                          Transport Type to be used (default: nonce-tcp:)
  --without-64-bit        If you have to use this option, please report it as
                          a bug
  --with-valgrind        Add instrumentation to help valgrind to understand
                          our allocator
  --with-x                use the X Window System
  --with-systemdsystemunitdir=DIR
                          Directory for systemd service files
  --with-dbus-test-dir=dirname
                          path where the tests tools are available

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS    linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  CXX        C++ compiler command
  CXXFLAGS    C++ compiler flags
  CPP        C preprocessor
  CXXCPP      C++ preprocessor
  PKG_CONFIG  path to pkg-config utility
  GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config
  GLIB_LIBS  linker flags for GLIB, overriding pkg-config
  DBUS_GLIB_CFLAGS
              C compiler flags for DBUS_GLIB, overriding pkg-config
  DBUS_GLIB_LIBS
              linker flags for DBUS_GLIB, overriding pkg-config
  PYTHON      the Python interpreter
  LIBXML_CFLAGS
              C compiler flags for LIBXML, overriding pkg-config
  LIBXML_LIBS linker flags for LIBXML, overriding pkg-config
  SYSTEMD_CFLAGS
              C compiler flags for SYSTEMD, overriding pkg-config
  SYSTEMD_LIBS
              linker flags for SYSTEMD, overriding pkg-config
  VALGRIND_CFLAGS
              C compiler flags for VALGRIND, overriding pkg-config
  VALGRIND_LIBS
              linker flags for VALGRIND, overriding pkg-config
  XMKMF      Path to xmkmf, Makefile generator for X Window System
  MAN2HTML    Path to man2html (optional)

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=dbus>.


Woodsman 04-23-2013 05:01 PM

I'm sure you intended to help, but I'm not the brightest bulb in the pack. Would you please be more specific? Thanks. :)

tuxbg 04-23-2013 05:13 PM

Quote:

Originally Posted by Woodsman (Post 4937515)
I'm sure you intended to help, but I'm not the brightest bulb in the pack. Would you please be more specific? Thanks. :)

Code:

SLKCFLAGS="-O2 -fPIC -rdynamic"

Woodsman 04-23-2013 05:46 PM

That is essentially the same thing I posted in my original post, but I tried anyway. Still no backtrace.

tuxbg 04-23-2013 06:56 PM

I think you need only this configure options
Code:

./configure --prefix=/usr \
        --with-dbus-user=dbus \
        --localstatedir=/var \
        --with-x


Woodsman 04-24-2013 02:51 PM

Thanks, but that does not help. :(

tuxbg 04-24-2013 02:54 PM

Quote:

Originally Posted by Woodsman (Post 4938141)
Thanks, but that does not help. :(

Ok add this option to configure
Code:

--enable-verbose-mode

Woodsman 04-24-2013 04:18 PM

I already tried that too. :)

the3dfxdude 04-24-2013 10:22 PM

Woodsman, I traced the message from the code backwards...

In dbus/dbus-sysdeps-unix.c

if ! defined (DBUS_BUILT_R_DYNAMIC)
fprintf (stderr, " D-Bus not built with -rdynamic so unable to print a backtrace\n");

Running configure with no options gave me in config.h
#undef DBUS_BUILT_R_DYNAMIC

In configure.ac:

if test x$enable_asserts = xno; then
AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking])
R_DYNAMIC_LDFLAG=""
else
# -rdynamic is needed for glibc's backtrace_symbols to work.
# No clue how much overhead this adds, but it's useful
# to do this on any assertion failure,
# so for now it's enabled anytime asserts are (currently not
# in production builds).

# To get -rdynamic you pass -export-dynamic to libtool.
AC_DEFINE(DBUS_BUILT_R_DYNAMIC,1,[whether -export-dynamic was passed to libtool])
R_DYNAMIC_LDFLAG=-export-dynamic
fi

So run ./configure --enable-asserts

Just my guess; didn't try it. So you don't need to set CFLAGS. It's actually LDFLAGS, but configure is supposed to do it for you with the right switch.

Oh btw, make sure you don't strip the binaries...


All times are GMT -5. The time now is 12:40 AM.