Bug 5147 - unsatisfied symbol 'fabs' in gprof
Summary: unsatisfied symbol 'fabs' in gprof
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gprof (show other bugs)
Version: 2.18
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-09 08:15 UTC by Michael Haubenwallner
Modified: 2007-10-12 16:36 UTC (History)
1 user (show)

See Also:
Host: hppa2.0w-hp-hpux11.11
Target: hppa2.0w-hp-hpux11.11
Build: hppa2.0w-hp-hpux11.11
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Haubenwallner 2007-10-09 08:15:47 UTC
When building binutils-2.18 on hppa-hpux11.11 (without gcc), linking gprof fails:

/bin/sh ./libtool --tag=CC --mode=link cc -Wp,-H256000  -O3   -o gprof 
basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o
gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o
alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o
../bfd/libbfd.la ../libiberty/libiberty.a
libtool: link: cc -Wp,-H256000 -O3 -o gprof basic_blocks.o call_graph.o
cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o
source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o
sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o  ../bfd/.libs/libbfd.a
../libiberty/libiberty.a
/usr/ccs/bin/ld: Unsatisfied symbols:
   fabs (first referenced in hist.o) (code)
   gmake[4]: *** [gprof] Error 1
   gmake[4]: Leaving directory `/build/binutils-2.18/gprof'
   gmake[3]: *** [all-recursive] Error 1
   gmake[3]: Leaving directory `/build/binutils-2.18/gprof'
   gmake[2]: *** [all] Error 2 
   gmake[2]: Leaving directory `/build/binutils-2.18/gprof'
   gmake[1]: *** [all-gprof] Error 2
   gmake[1]: Leaving directory `/build/binutils-2.18'
   gmake: *** [all] Error 2

It does help to check for fabs() in libm, like done for frexp() in
binutils/configure:

--- binutils-2.18/gprof/configure.in.orig   2007-10-09 09:22:17.289705000 +0200
+++ binutils-2.18/gprof/configure.in    2007-10-09 09:24:26.745972000 +0200
@@ -44,6 +44,9 @@
        [Is the prototype for getopt in <unistd.h> in the expected format?])
 fi

+# Some systems have fabs only in -lm, not in -lc.
+AC_SEARCH_LIBS(fabs, m)
+
 AM_BINUTILS_WARNINGS

 dnl Required by html and install-html
Comment 1 Nick Clifton 2007-10-12 16:36:31 UTC
Hi Michael,

  Thanks for the bug report and patch.  I have checked your suggested fix in
together with this changelog entry.

Cheers
  Nick

gprof/ChangeLog
2007-10-12  Michael Haubenwallner  <haubi@gentoo.org>

	PR gprof/5147
	* configure.in: Add check for fabs() being in libm.
	* configure: Regenerate.