Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: stefanha@gmail.com (stefanha@gmail.com)
Subject: [ltt-dev] [PATCH] Always link against libm
Date: Sun, 23 May 2010 17:30:43 +0100	[thread overview]
Message-ID: <4bf9583d.541ee30a.6849.ffffd49a@mx.google.com> (raw)

From: Stefan Hajnoczi <stefanha@gmail.com>

This patch makes builds --without-lttv-gui work by linking against libm.

Signed-off-by: Stefan Hajnoczi <stefanha at gmail.com>
---
This patch is my attempt to fix the following build issue:

Building --without-lttv-gui produces linker errors due to missing libm.  The
build works fine when GUI is enabled.

This issue happens with lttv-0.12.31-04072010 and lttv.git:

$ ./configure --without-lttv-gui
$ make
/bin/bash ../../libtool --tag=CC   --mode=link gcc -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -Wall -Wformat -g -O2 -export-dynamic   -o lttv.real batchtest.o main.o module.o option.o hook.o attribute.o iattribute.o state.o stats.o tracecontext.o traceset.o filter.o print.o sync_chain.o sync_chain_lttv.o graph_functions.o data_structures.o event_processing_lttng_common.o event_processing_lttng_standard.o event_processing_lttng_null.o event_matching_broadcast.o event_matching_distributor.o event_matching_tcp.o event_analysis_chull.o event_analysis_eval.o event_analysis_linreg.o factor_reduction_accuracy.o -lpopt   ../../ltt/liblttvtraceread.la -lpthread   -pthread -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0   -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lglib-2.0
libtool: link: gcc -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -Wformat -g -O2 -o .libs/lttv.real batchtest.o main.o module.o option.o hook.o attribute.o iattribute.o state.o stats.o tracecontext.o traceset.o filter.o print.o sync_chain.o sync_chain_lttv.o graph_functions.o data_structures.o event_processing_lttng_common.o event_processing_lttng_standard.o event_processing_lttng_null.o event_matching_broadcast.o event_matching_distributor.o event_matching_tcp.o event_analysis_chull.o event_analysis_eval.o event_analysis_linreg.o factor_reduction_accuracy.o -pthread -Wl,--export-dynamic -pthread -Wl,--export-dynamic  /usr/lib/libpopt.so ../../ltt/.libs/liblttvtraceread.so -lpthread /usr/lib/libgobject-2.0.so /usr/lib/libgthread-2.0.so /usr/lib/libgmodule-2.0.so -lrt /usr/lib/libglib-2.0.so -pthread
event_analysis_chull.o: In function `calculateFactorsMiddle':
/tmp/lttv/lttv/lttv/sync/event_analysis_chull.c:987: undefined reference to `sqrt'
event_analysis_eval.o: In function `printAnalysisStatsEval':
/tmp/lttv/lttv/lttv/sync/event_analysis_eval.c:894: undefined reference to `sqrt'
event_analysis_eval.o: In function `analyzeBroadcastEval':
/tmp/lttv/lttv/lttv/sync/event_analysis_eval.c:751: undefined reference to `sqrt'
event_analysis_eval.o: In function `binNum':
/tmp/lttv/lttv/lttv/sync/event_analysis_eval.c:1311: undefined reference to `log'
/tmp/lttv/lttv/lttv/sync/event_analysis_eval.c:1311: undefined reference to `log'
/tmp/lttv/lttv/lttv/sync/event_analysis_eval.c:1311: undefined reference to `floor'
event_analysis_eval.o: In function `binStart':
/tmp/lttv/lttv/lttv/sync/event_analysis_eval.c:1343: undefined reference to `pow'
event_analysis_eval.o: In function `binEnd':
/tmp/lttv/lttv/lttv/sync/event_analysis_eval.c:1370: undefined reference to `pow'
event_analysis_linreg.o: In function `finalizeLSA':
/tmp/lttv/lttv/lttv/sync/event_analysis_linreg.c:317: undefined reference to `sqrt'
collect2: ld returned 1 exit status
make[4]: *** [lttv.real] Error 1

System info:
Linux 2.6.32-3-amd64
autoconf (GNU Autoconf) 2.65
gcc (Debian 4.4.4-1) 4.4.4
GNU assembler (GNU Binutils for Debian) 2.20.1-system.20100303

 configure.ac |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 69d3809..b3b86fb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -156,7 +156,7 @@ fi
 pkg_modules="gobject-2.0 >= 2.0.0"
 PKG_CHECK_MODULES(GOBJECT, [$pkg_modules])
 
-LIBS="$LIBS $GTK_LIBS $GOBJECT_LIBS $GMODULE_LIBS"
+LIBS="$LIBS $M_LIBS $GTK_LIBS $GOBJECT_LIBS $GMODULE_LIBS"
 PACKAGE_CFLAGS="$GTK_CFLAGS $GOBJECT_CFLAGS $GMODULE_CFLAGS -Wall -Wformat"
 MODULE_CFLAGS="$PACKAGE_CFLAGS -fvisibility=hidden"
 MODULE_LDFLAGS="-module -avoid-version"
-- 
1.7.1





             reply	other threads:[~2010-05-23 16:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-23 16:30 stefanha [this message]
2010-05-25 14:37 ` Pierre-Marc Fournier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4bf9583d.541ee30a.6849.ffffd49a@mx.google.com \
    --to=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox