[Home]

Summary:ASTERISK-13060: [patch] libtonezone requires -lm
Reporter:Tzafrir Cohen (tzafrir)Labels:
Date Opened:2008-11-12 09:39:31.000-0600Date Closed:2008-12-11 14:02:31.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/BuildSystem
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) libtonezone_libm
Description:It seems that at least in dahdi-tools 2.0.0 libtonezone depends on libm . Hence the configure script failes to detect it, as we get link failures with 'pow', 'cos' and others missing.

Tested with 1.6.0.1 , but from a quick look I don't think this has been resolved in trunk yet.

****** ADDITIONAL INFORMATION ******

The relevant part from config.log before the fix:

configure:45542: result: no
configure:45748: checking for tone_zone_find in -ltonezone
configure:45783: x86_64-linux-gnu-gcc -o conftest -g -O2   conftest.c -ltonezone     >&5
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libtonezone.a(tonezone.o): In function `build_mf_tones':
(.text+0x11e): undefined reference to `pow'
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libtonezone.a(tonezone.o): In function `build_mf_tones':
(.text+0x14d): undefined reference to `cos'
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libtonezone.a(tonezone.o): In function `build_mf_tones':
(.text+0x173): undefined reference to `sin'
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libtonezone.a(tonezone.o): In function `build_mf_tones':
(.text+0x1c2): undefined reference to `sin'
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libtonezone.a(tonezone.o): In function `build_mf_tones':
(.text+0x1e5): undefined reference to `pow'
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libtonezone.a(tonezone.o): In function `build_mf_tones':
(.text+0x218): undefined reference to `cos'
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libtonezone.a(tonezone.o): In function `build_mf_tones':
(.text+0x23e): undefined reference to `sin'
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libtonezone.a(tonezone.o): In function `build_mf_tones':
(.text+0x28d): undefined reference to `sin'
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libtonezone.a(tonezone.o): In function `tone_zone_register_zone':
(.text+0x5ca): undefined reference to `cos'
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libtonezone.a(tonezone.o): In function `tone_zone_register_zone':
(.text+0x5f0): undefined reference to `sin'
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libtonezone.a(tonezone.o): In function `tone_zone_register_zone':
(.text+0x612): undefined reference to `sin'
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libtonezone.a(tonezone.o): In function `tone_zone_register_zone':
(.text+0x64b): undefined reference to `cos'
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libtonezone.a(tonezone.o): In function `tone_zone_register_zone':
(.text+0x671): undefined reference to `sin'
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libtonezone.a(tonezone.o): In function `tone_zone_register_zone':
(.text+0x693): undefined reference to `sin'
collect2: ld returned 1 exit status
Comments:By: Matthias Urlichs (smurfix) 2008-11-14 07:53:46.000-0600

Note that this is only a problem if you use a statically-built libtonezone.

However: I don't think static libraries make any sense in an environment like Asterisk, where you dynamically load modules.

By: Digium Subversion (svnbot) 2008-12-11 14:02:31.000-0600

Repository: asterisk
Revision: 163168

U   trunk/configure
U   trunk/configure.ac

------------------------------------------------------------------------
r163168 | tilghman | 2008-12-11 14:02:30 -0600 (Thu, 11 Dec 2008) | 5 lines

Sometimes even Linux needs -lm to link libtonezone, such as when libtonezone
is compiled statically.
(closes issue ASTERISK-13060)
Reported by: tzafrir

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=163168